Re: objc_msgSend_ptr
Re: objc_msgSend_ptr
- Subject: Re: objc_msgSend_ptr
- From: "Tilo Villwock" <email@hidden>
- Date: Fri, 26 Sep 2008 17:23:22 +0200
That did the trick, thanks a lot. Seems like I need to review a few concepts
here.
-----Ursprüngliche Nachricht-----
Von: chaitanya pandit [mailto:email@hidden]
Gesendet: Freitag, 26. September 2008 12:25
An: Tilo Villwock
Cc: email@hidden
Betreff: Re: objc_msgSend_ptr
if your sizeOfFile: method is returning an integer, then you should
convert it to NSNumber
like:
object = [NSNumber numberWithInt:[[files objectAtIndex:rowIndex]
sizeOfFile]];
hth,
Chaitanya
On 25-Sep-08, at 5:22 PM, Tilo Villwock wrote:
> i have the following piece of code in my controller class:
>
> - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:
> (NSTableColumn *)aTableColumn row:(int)rowIndex{
> id object = nil;
> if([tableView columnWithIdentifier:[aTableColumn identifier]] == 1){
> object = [[files objectAtIndex:rowIndex] name];
> }
> if([tableView columnWithIdentifier:[aTableColumn identifier]] == 2){
> object = (id)[[files objectAtIndex:rowIndex] sizeOfFile];
> }
> return object;
> }
>
> it provides the NSTableView in my app with content. For some reason
> i cannot assign:
>
> object = (id)[[files objectAtIndex:rowIndex] sizeOfFile];
>
> or at least an error occurs i cannot figure out. In the debugger the
> last item on top of the stack is something like "objc_msgSend_ptr".
> Now "files" here is an instance of NSMutableArray and the method
> "sizeOfFile" belongs to a custom class and returns the size properly.
>
> I'm pretty new to Cocoa and Objective-C and being used to java, i'm
> not quite familiar with memory management (alloc/release/retain
> etc.). Maybe there is something i'm missing here. I'm running 10.4
> Tiger.
>
> Thanks in advance.
>
> Tilo
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden