Become a MacRumors Supporter for $25/year with no ads, private forums, and more!

Mac UITableViewDataSource build error

Enuratique

macrumors 6502
Original poster
Apr 28, 2008
276
0
Yet another problem guys. I'm so close to finishing but I'm getting a build error when I try to override the cellForRowAtIndexPath delegate method. I'm just doing what is done in UIShowcase AS WELL AS The TableViewSuite examples.

Code:
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyIdentifier"];
if (cell == nil) {
  cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reusableIdentifer:@"MyIdentifier"] autorelease];
// set text of cell
}

The build error I get is related to the CGRectZero:

Building target “WordsterAssistant” of project “WordsterAssistant” with configuration “Debug” — (1 error)

Undefined symbols:
"_CGRectZero", referenced from:
_CGRectZero$non_lazy_ptr in WordsterAssistantDataSource.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
"_CGRectZero", referenced from:
_CGRectZero$non_lazy_ptr in WordsterAssistantDataSource.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Build failed (1 error)

I double checked to make sure I was including all the Framework header files that the example sources included but I'm stumped. Any ideas?

This object's interface is defined as
Code:
@interface WordsterAssistantDataSource : NSObject <UITableViewDataSource>

Do I also need to have this object implement the UITableViewDelegate protocol as well? I don't need any of its functionality.
 

Sbrocket

macrumors 65816
Jun 3, 2007
1,250
0
/dev/null
Are you sure you have CoreGraphics.framework added to the project AND the target checkbox checked so that its actually linked in?
 
Comment

iPhoneczar

macrumors newbie
Apr 4, 2008
6
0
Same Issue

Are you sure you have CoreGraphics.framework added to the project AND the target checkbox checked so that its actually linked in?

I've got my app working in iPhone Simulator but when I go to device/debug I'm getting the _CGRectZero lazy pointer error. I'm still learning Xcode. What TARGET box is supposed to be checked. I haven't found it yet.

-dB
 
Comment

alephx01

macrumors newbie
Jun 25, 2007
4
0
Targets

Click on Frameworks under Groups & Files pane in the XCode project window. One of the columns on the right side will look like a bullseye, and there should be checkboxes under them. Make sure the CoreGraphics one is checked.
 
Comment

iPhoneczar

macrumors newbie
Apr 4, 2008
6
0
CGRectZero Workaround

I got my app to work by replacing the reference to CGRectZero with CGRectMake(0,0,0,0)

Then later I discovered that I had only aparently loaded some of the required libraries by dragging and dropping them from one project to another rather than using the add new files function. When I added the necessary frameworks the "correct" way then my app started recognizing CGRectZero properly.

CGRectMake(0,0,0,0) was reported in one of the threads I read as equivalent to CGRectZero

YMMV but it worked for me.

-dB
 
Comment

gpmoore

macrumors newbie
Jul 23, 2008
2
0
Thanks, this fixes the just find and replace CGRectZero with CGRectMake(0,0,0,0) and it will compile and run.

Still, I think as iPhoneczar points out, I may have done the drag & drop too and that may have been the problem.

Thanks for the tips:)!!
 
Comment
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.