Essayer de NSLog un NSarumber ivar dans une méthode d'instance

Je suis en train de travailler sur une application console qui est des pistes différentes chansons. Je suis en train de travailler sur l'obtention de la chanson de la classe vers le haut sur le sol en premier et l'un hic, en essayant de vous connecter un nsnumber qui a été alloué pour la durée de la chanson dans un nslog déclaration:

//
// Song.h
// MusicCollection.15.9   
//
// Created by Nicholas Iannone on 1/11/10.
   // Copyright 2010 __MyCompanyName__. All rights reserved.
   //

   #import <Foundation/Foundation.h>


@interface Song : NSObject {

NSString *songTitle;
NSString *songArtist;
NSString *songAlbum;
NSNumber *SongDuration; 
}
@property (nonatomic, retain) NSString *songTitle, *songArtist, *songAlbum;
@property (nonatomic, retain) NSNumber *SongDuration;

-(id) init;


-(void) printSong;



@end


//
// Song.m
// MusicCollection.15.9    
//
// Created by Nicholas Iannone on 1/11/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "Song.h"


@implementation Song

@synthesize  songTitle, songArtist, songAlbum;
@synthesize SongDuration;

-(id) init
{

if (self = [super init]) {

    [SongDuration numberWithInteger];
}

-(void) printSong
{



NSLog(@"===============Song Info==================");
NSLog (@"|                                       |");
NSLog (@"| %-31s |", [songTitle UTF8String]);
NSLog (@"| %-31s |", [songArtist UTF8String]);
NSLog (@"| %-31s |", [songAlbum UTF8String]);                                       
NSLog (@"| %31@   |"  [self songDuration]);
NSLog (@"|                                       |");
NSLog (@"|                                       |");
NSLog (@"=========================================");

}
@end

Fondamentalement, je ne suis pas sûr de savoir comment intégrer la nsnumber dans le nslog instruction lorsque la méthode d'impression est appelée, en plus je ne suis pas vraiment sûr de savoir comment faire face à ces nsobjects en général, ils semblent en quelque sorte dans-entre un objet je serais de créer et d'une c type. Toutes les précisions sur la manière de gérer ces serait appréciée.

Merci,

Nick

source d'informationauteur nickthedude