Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-08-2011, 12:58 PM   #1 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 7
ahsan87 is on a distinguished road
Unhappy weird problem with UILabel

I am using UILabel for custom cells in my UITableView. Heres all the code that I am using :

header file:

Code:
UILabel *timeLabels;
@property (nonatomic, retain) UILabel *timeLabels;
code file:

Code:
- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier

    timeLabels=[[UILabel alloc] init];
    timeLabels.textAlignment=UITextAlignmentLeft;
    timeLabels.font=[UIFont boldSystemFontOfSize:12];
    timeLabels.backgroundColor=[UIColor clearColor];
    timeLabels.textColor=[UIColor blueColor];

- (void) layoutSubviews

   frame=CGRectMake(boundsX+5, 5, 60, 45);
   timeLabels.frame=frame;

[timeLabels release]
I am getting the following error on timeLabels.frame=frame;

Code:
2011-08-08 12:44:07.290 EncameoApp[2014:707] -[NSCFString setFrame:]: unrecognized selector sent to instance 0x136890
2011-08-08 12:44:07.361 EncameoApp[2014:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString setFrame:]: unrecognized selector sent to instance 0x136890'
Which is pretty strange given that timeLabels is not a NSString, but rather a UILabel !

Can anyone please let me know what I missed here ? Thanks.
ahsan87 is offline   Reply With Quote
Old 08-08-2011, 02:07 PM   #2 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,983
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

can you actually put all of your custom cell code, rather than only the snippets that you think is relevant?
smithdale87 is offline   Reply With Quote
Old 08-08-2011, 05:44 PM   #3 (permalink)
Registered Member
 
Join Date: May 2011
Posts: 8
taylortm is on a distinguished road
Default

Did you validate that the object referenced by
Code:
 instance 0x136890
is, indeed, an object of type UILabel? My guess is that it is not and that it is, in fact, an NSCFString type object.

Obviously, if that's the case, you will want to either share more code or do some debugging.

Just out of curiousity, wondering if you're compiling with LLVM and wondering if Xcode, itself, is able to give you any "hints" (read: warnings) about the source of this bug?
taylortm is offline   Reply With Quote
Old 08-08-2011, 06:25 PM   #4 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 149
crashmonkey is on a distinguished road
Default

There are no curly braces around your methods so it is hard to tell where your
release statement is called.

It looks like your label release is outside any method in the body of the file.
Shouldn't that be in the dealloc method?
crashmonkey is offline   Reply With Quote
Reply

Bookmarks

Tags
ios, uilabel

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 408
16 members and 392 guests
7twenty7, blasterbr, chiataytuday, cristofercolmbos, dedeys78, dre, fiftysixty, gmarro, HemiMG, jimmyon122, jonathandeknudt, LEARN2MAKE, pungs, raymng, tymex, UMAD
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,669
Threads: 94,121
Posts: 402,903
Top Poster: BrianSlick (7,990)
Welcome to our newest member, dedeys78
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:06 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0