PDA

View Full Version : UITableViewDataSource build error




Enuratique
Jun 24, 2008, 02:12 PM
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.


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

@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
Jun 24, 2008, 02:17 PM
Are you sure you have CoreGraphics.framework added to the project AND the target checkbox checked so that its actually linked in?

Enuratique
Jun 24, 2008, 02:18 PM
Are you sure you have CoreGraphics.framework added to the project AND the target checkbox checked so that its actually linked in?

That was the problem! Thanks yet again!

iPhoneczar
Jul 12, 2008, 09:38 PM
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

alephx01
Jul 15, 2008, 12:31 AM
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.

iPhoneczar
Jul 15, 2008, 02:06 PM
Thanks for the help. I'm good now

gpmoore
Jul 23, 2008, 11:54 PM
I have the box checked and I am still having the same problem??

iPhoneczar
Jul 24, 2008, 01:31 PM
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

gpmoore
Jul 25, 2008, 08:35 AM
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:)!!