CGRect and utesting

I am trying to add unit tests to my iPhone project in Xcode. Everything works, its great. Except when I am adding a class.m that uses CGRect (or other structs, CGPoint etc) to the unit test target (under "Compile Sources") - I am getting a compilation error: "'CGRect' undeclared (first use in this function)". I tried messing with my unit test target in various ways, but so far I haven't been able to get past this. What am I missing?

Answers


If it's undeclared, you haven't included the CoreGraphics header file:

#import <CoreGraphics/CoreGraphics.h>

You need to add the CoreGraphics framework to your unit testing target. In your project, under Frameworks, right-click on CoreGraphics.framework and select "Get Info". Click the "Targets" button at the top of the info window, and check the box next to your unit testing target.


Need Your Help

MDM profile installation check

iphone ios objective-c ipad mdm

I am making an application which installs a MDM profile on the device. The profile is getting installed successfully from the server.

Configuring custom authorization with ELMAH

c# asp.net asp.net-mvc asp.net-mvc-4 elmah

How can I configure ELMAH to display only for certain people without default ASP.NET authorization roles manager?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.