• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [NEWB] An object, an array item and a string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [NEWB] An object, an array item and a string


  • Subject: Re: [NEWB] An object, an array item and a string
  • From: Aron Spesard <email@hidden>
  • Date: Sun, 7 Sep 2008 13:03:52 -0400

Thank you, I had overlooked that. I fixed that, however that doesn't fix the app crashing when trying to set the textfield contents as a string, or why I get the path in the sheet function but not in this one...


On Sep 6, 2008, at 11:24 PM, Nathan Kinsinger wrote:


On Sep 6, 2008, at 7:10 PM, Aron Spesard wrote:

So after reading the various image viewer tutorials on the web and getting through the StretchView chapter in Cocoa Programming for MAC OS X, I decided to try and write one that takes a couple of arrays of images and composites two images together. Click a button and the view updates to the next composite image.
I was able to get the items in the arrays from open sheets and that all made sense. Before I even tried to start drawing things in Rect I tried to just put the path in a text box with the click of a button. I thought the below was the way to go:


- (IBAction)viewClientFiles:(id)sender
{
	NSString *imagePath = (clientFileName);
	[textField setStringValue:imagePath];
	NSLog(@"current client file name:%a",imageName);
}	

which compiles but hangs the app

The thing I don't really understand is that when I log clientFileName in openPanelDidEnd action
the log is the path to the file, but in the above action it's "0x1.838000f085p-1029"


Why is that and how can I get that item's path?

thanks,
Aaron

The problem is the %a in the NSLog string. %a is a floating point number in hex format. In this case it's converting the address of the pointer imageName to a hex floating point number.


The correct conversion character for NSStrings (or most any Objective-C object) is %@.

--Nathan
_______________________________________________

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:
@gmail.com


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


  • Follow-Ups:
    • Re: [NEWB] An object, an array item and a string
      • From: Ken Thomases <email@hidden>
References: 
 >[NEWB] An object, an array item and a string (From: Aron Spesard <email@hidden>)
 >Re: [NEWB] An object, an array item and a string (From: Nathan Kinsinger <email@hidden>)

  • Prev by Date: Re: Posting Keyboard Events
  • Next by Date: Re: [NEWB] An object, an array item and a string
  • Previous by thread: Re: [NEWB] An object, an array item and a string
  • Next by thread: Re: [NEWB] An object, an array item and a string
  • Index(es):
    • Date
    • Thread