Re: ivars and fundamental types

2010-10-08 Thread Dave DeLong
And its inverse, object_setInstanceVariable, which takes a void* to the new value of the ivar. Cheers, Dave On Oct 8, 2010, at 10:18 PM, Dave Keck wrote: >> object_setIvar() takes type id. > > object_getInstanceVariable()? > > "outValue: On return, contains a pointer to the value of the inst

Re: ivars and fundamental types

2010-10-08 Thread Dave Keck
> object_setIvar() takes type id. object_getInstanceVariable()? "outValue: On return, contains a pointer to the value of the instance variable." ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comm

Re: ivars and fundamental types

2010-10-08 Thread Rick Mann
On Oct 8, 2010, at 20:04:13, Sherm Pendley wrote: > On Fri, Oct 8, 2010 at 9:50 PM, Rick Mann wrote: >> Can I not use the objective-C runtime to get and set an objects ivar's if >> they are of primitive types like int and float? > > Of course you can - it would be useless otherwise. Where did

Re: ivars and fundamental types

2010-10-08 Thread Sherm Pendley
On Fri, Oct 8, 2010 at 9:50 PM, Rick Mann wrote: > Can I not use the objective-C runtime to get and set an objects ivar's if > they are of primitive types like int and float? Of course you can - it would be useless otherwise. Where did you get the idea you can't? sherm-- -- Cocoa programming

Re: CPP reference operator

2010-10-08 Thread Scott Ribe
On Oct 8, 2010, at 4:20 PM, k...@highrolls.net wrote: > Ergo, this seem to be a 'bug' in the Xcode debugger. > > Cost me lots of time though. Sorry, but if you're going to use Objective-C++, you're going to have get used to that. The debugger ***SUX*** at display of C++ types, so when you see

Re: Trouble calling class_addIvar()

2010-10-08 Thread Bill Bumgarner
On Oct 8, 2010, at 5:27 PM, Rick Mann wrote: > Hmm...thinking about it a bit more...how do dynamically-synthesized property > ivars work (where you just @synthesize them without declaring an ivar)? Do > they use class_addIvar()? That suggests I'm wrong about class layout. It be compilation tim

SRV record lookup

2010-10-08 Thread Jeremy Matthews
In one of my apps (Cocoa Desktop 10.6+ - not iOS) I need to perform some SRV lookups; I know there are a few ways to do this, but I'd like to know if anyone can speak from experiencefrom this link I can see that there are indeed a few different methodsany ideas? http://stackoverflow.com

ivars and fundamental types

2010-10-08 Thread Rick Mann
Can I not use the objective-C runtime to get and set an objects ivar's if they are of primitive types like int and float? -- Rick ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the l

Re: main window disappears on resize

2010-10-08 Thread Kyle Sluder
On Fri, Oct 8, 2010 at 5:28 PM, Shane wrote: > I have a document based application with a main window that, when I > try to resize the window, the window just completely disappears. The > application doesn't crash and I can open up another window by 'Project > --> New' in the main menu. And of cou

main window disappears on resize

2010-10-08 Thread Shane
I have a document based application with a main window that, when I try to resize the window, the window just completely disappears. The application doesn't crash and I can open up another window by 'Project --> New' in the main menu. And of course if I try to resize it, it will disappear. And my d

Re: Trouble calling class_addIvar()

2010-10-08 Thread Rick Mann
On Oct 8, 2010, at 17:12:28, Kyle Sluder wrote: > The documentation states you can't add ivars to classes that have > already been registered. In order for a class to receive +initialize, > it logically must already have been registered with the runtime. > Therefore, it's quite apparent why class

Re: Trouble calling class_addIvar()

2010-10-08 Thread Rick Mann
Oh. I can't even really use this. I don't know what I need to associate at runtime, at which point I know what it is by a string value. Since I can't use a string value as a key, I can't really make the association. I could associate an NSMutableDictionary, but if I do that, I may as well just m

Re: Trouble calling class_addIvar()

2010-10-08 Thread Rick Mann
On Oct 8, 2010, at 17:12:28, Kyle Sluder wrote: > On Fri, Oct 8, 2010 at 5:00 PM, Rick Mann wrote: >> Yes, I read that. I had hoped that I'd be able to add ivars before the class >> was instantiated. In this case, the class is being loaded dynamically at run >> time. Is there no way to get in

Re: Trouble calling class_addIvar()

2010-10-08 Thread Kyle Sluder
On Fri, Oct 8, 2010 at 5:00 PM, Rick Mann wrote: > Yes, I read that. I had hoped that I'd be able to add ivars before the class > was instantiated. In this case, the class is being loaded dynamically at run > time. Is there no way to get in the middle of the load and add an ivar? > > In any case

Re: Trouble calling class_addIvar()

2010-10-08 Thread Rick Mann
On Oct 8, 2010, at 16:42:18, Kyle Sluder wrote: > On Fri, Oct 8, 2010 at 4:39 PM, Rick Mann wrote: >> I'm trying to add an ivar to a (sub)class in the base class' +initialize >> method. I'm not sure if it's too late to do it at this point or not. If I >> can't do it here, i don't know where to

Re: Trouble calling class_addIvar()

2010-10-08 Thread Dave DeLong
I think you can only use class_addIvar() in between corresponding calls to objc_allocateClassPair() and objc_registerClass(). Docs: http://developer.apple.com/library/ios/documentation/cocoa/reference/ObjCRuntimeRef/Reference/reference.html#//apple_ref/doc/uid/TP40001418-CH1g-SW10 Dave On Oct

Re: Trouble calling class_addIvar()

2010-10-08 Thread Kyle Sluder
On Fri, Oct 8, 2010 at 4:39 PM, Rick Mann wrote: > I'm trying to add an ivar to a (sub)class in the base class' +initialize > method. I'm not sure if it's too late to do it at this point or not. If I > can't do it here, i don't know where to make the call. >From the documentation: "Adding an i

Trouble calling class_addIvar()

2010-10-08 Thread Rick Mann
I'm trying to add an ivar to a (sub)class in the base class' +initialize method. I'm not sure if it's too late to do it at this point or not. If I can't do it here, i don't know where to make the call. I'm calling it like this: char const* ivarNameCString = ivarName.UTF8String;

Re: Freeing the property list returned by class_copyPropertyList()?

2010-10-08 Thread Dave DeLong
free(). Dave On Oct 8, 2010, at 5:22 PM, Rick Mann wrote: > How do I free the array I get back from class_copyPropertyList()? > > TIA, > > -- > Rick > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin reque

Freeing the property list returned by class_copyPropertyList()?

2010-10-08 Thread Rick Mann
How do I free the array I get back from class_copyPropertyList()? TIA, -- Rick ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)

Re: Making Java Calls from Objective-C !!

2010-10-08 Thread Greg Guerin
Nick Zitzmann wrote: So I found this, which has an answer that is not "use the bridge" but I haven't tried it myself: One of its answers is "use TCP/IP". I have done that, and it works well. Same-p

UITableViewCell Display Issue

2010-10-08 Thread Jason Barker
In my table view, when a user touches a row, I want to change the alpha value of a subview within the row's content view via animation as well as insert some rows below that one or remove some rows from below that one. I'm able to animate the insertion and deletion of the rows from under the touche

Re: Making Java Calls from Objective-C !!

2010-10-08 Thread Greg Guerin
Naresh Kongara wrote: I want to know how to make java calls from Obj-C. (Java Bridge Seems to be deprecated). Is it possible with out bridge ? If yes , Can any body help me on Where to start ? Use JNI. Also see this Java-Dev message: http://lists.apple.com/archives/java-dev/2009/Oct/msg00

Re: Problem connecting to Oracle with app run from XCode

2010-10-08 Thread Timothy Mowlem
> Greg Guerin wrote: >> Timothy Mowlem wrote: >> >> I can run the XCode built app as well from the command line after >> setting LD_LIBRARY_PATH (as a non-admin user and without using sudo). > If that env-var is the cause, then printf() the value of it in both > cases, and manually compare t

Re: CPP reference operator

2010-10-08 Thread koko
Well, it appears that the problem is not a language problem. I was passing a reference to a CPP object instance, doing some work and then setting member variables in the CPP object instance. Upon inspecting the CPP object instance member variables upon return they were displaying 'garbage'

Re: Making Java Calls from Objective-C !!

2010-10-08 Thread Daryl Thachuk
Hi Yes, it can be done but you need to become good friends with JNI. http://developer.apple.com/library/mac/#technotes/tn2005/tn2147.html Good luck! -daryl -- Daryl Thachuk Montage Technologies Inc. http://www.montagetech.com On Oct 8, 2010, at 3:25 PM, Naresh Kongara wrote: > I want to

Re: Making Java Calls from Objective-C !!

2010-10-08 Thread Naresh Kongara
Hi, I think rococoa is for making Objective-C calls from Java, not in opposite way (making Java Calls from Objective-C). Thanks. Kongara On Oct 8, 2010, at 2:34 PM, Rui Pacheco wrote: > Just Objective-C or Cocoa? > > Try this: https://rococoa.dev.java.net/ > > On 8 October 2010 22:25, Nare

Re: Making Java Calls from Objective-C !!

2010-10-08 Thread Nick Zitzmann
On Oct 8, 2010, at 3:25 PM, Naresh Kongara wrote: > Hi, > > I want to know how to make java calls from Obj-C. (Java Bridge Seems to be > deprecated). > Is it possible with out bridge ? If yes , Can any body help me on Where to > start ? Under normal circumstances I would be tempted to say "ST

Making Java Calls from Objective-C !!

2010-10-08 Thread Naresh Kongara
Hi, I want to know how to make java calls from Obj-C. (Java Bridge Seems to be deprecated). Is it possible with out bridge ? If yes , Can any body help me on Where to start ? Thanks, Kongara___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Plea

Re: CPP reference operator

2010-10-08 Thread Kyle Sluder
On Fri, Oct 8, 2010 at 2:09 PM, wrote: > I did and was getting, and still am, invalid results. So, I asked to be sure > I was not violating something and thereby getting invalid results. > > I ain't that lame ... In that case, be more forthcoming in describing your specific problem. "Can I do X

Re: CPP reference operator

2010-10-08 Thread koko
I did and was getting, and still am, invalid results. So, I asked to be sure I was not violating something and thereby getting invalid results. I ain't that lame ... -koko On Oct 8, 2010, at 3:07 PM, Kyle Sluder wrote: On Fri, Oct 8, 2010 at 1:45 PM, wrote: can parms be passed to obj-

Re: CPP reference operator

2010-10-08 Thread Kyle Sluder
On Fri, Oct 8, 2010 at 1:45 PM, wrote: > can parms be passed to obj-c methods by reference as in > > name:(type&)parm You know, you can try these things out before you ask the mailing list. http://gist.github.com/617545 --Kyle Sluder ___ Cocoa-dev m

Re: Problem using dictionary

2010-10-08 Thread Fritz Anderson
On 8 Oct 2010, at 3:14 PM, Remco Poelstra wrote: > That seems reasonable, but makes the documentation harder to read. In the old > days where I used Delphi, the inherited methods were all shown as such and it > gives a direct overview of what is available. Especially in this case, where > the v

Re: CPP reference operator

2010-10-08 Thread Nick Zitzmann
On Oct 8, 2010, at 2:45 PM, k...@highrolls.net wrote: > can parms be passed to obj-c methods by reference as in > > name:(type&)parm Yes, but only if you use ObjC++. Nick Zitzmann ___ Cocoa-dev mailing list (Cocoa-dev@l

Re: CPP reference operator

2010-10-08 Thread koko
Thanks. I am compiling Objective-C++; -koko On Oct 8, 2010, at 2:57 PM, Dave Carrigan wrote: On Oct 8, 2010, at 1:45 PM, k...@highrolls.net wrote: can parms be passed to obj-c methods by reference as in name:(type&)parm Yes, as long as you're compiling as Objective-C++ (i.e., your file

CPP reference operator

2010-10-08 Thread koko
can parms be passed to obj-c methods by reference as in name:(type&)parm ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.ap

Re: Problem using dictionary

2010-10-08 Thread Remco Poelstra
Op 8 okt 2010, om 20:34 heeft Quincey Morris het volgende geschreven: On Oct 8, 2010, at 04:47, Remco Poelstra wrote: Is there a reason valueForKey: is documented directly but valueForKeyPath: is not? They're both documented, but it requires familiarity with how to read the Cocoa document

Re: Return value of performSelector:onThread:?

2010-10-08 Thread Bill Bumgarner
On Oct 8, 2010, at 11:52 AM, Kyle Sluder wrote: > Using GCD: > > id myObj; > dispatch_sync(dispatch_get_main_queue(), ^{ myObj = CreateTheObject(); }); __block id myObj; > dispatch_sync(dispatch_get_main_queue(), ^{ myObj = CreateTheObject(); }); ___

[iOS] NSUserDefaults-backed Properties

2010-10-08 Thread Carter Allen
Hello everyone! I'm working on cleaning up an app that was written by a colleague of mine a while ago, and one of the things that he did quite a bit was use "properties" (declared as @properties, with custom getters/setters) that are actually backed by NSUserDefaults. Seemingly, this was to pro

Re: confused about floats

2010-10-08 Thread Kyle Sluder
Just wanted to confirm that this is a repost of the previous thread? http://lists.apple.com/archives/cocoa-dev/2010/Oct/msg00117.html --Kyle Sluder On Tue, Oct 5, 2010 at 2:07 AM, Amy Heavey wrote: > I've got two float values (x and y) that I'm using to change the coordinates > of a drawing act

Re: confused about floats

2010-10-08 Thread Murat Konar
A stripped down version of your code works as expected here. - (IBAction) test:(id) sender { //set coordinates to x,y -> 0,0 to start float x = 0; float y = 0; while (YES) { NSLog(@"x = %f, y = %f", x, y); x = x+100; //if coordinates are too

Re: Return value of performSelector:onThread:?

2010-10-08 Thread Seth Willits
On Oct 7, 2010, at 10:49 PM, Abhi Beckert wrote: > The performSelector: methods don't expose the return value of the message, > even with waitUntilDone:YES. I'm not happy with my workaround, which is to > use an instance variable: Use the withObject: parameter. If you use a mutable dictionary,

Re: Return value of performSelector:onThread:?

2010-10-08 Thread Kyle Sluder
On Thu, Oct 7, 2010 at 10:49 PM, Abhi Beckert wrote: > I have a background thread which needs the main thread to create an object > (because part of the initializer isn't thread safe). > > The performSelector: methods don't expose the return value of the message, > even with waitUntilDone:YES. I

Re: Not understanding NSString's compare:options:range:locale: method

2010-10-08 Thread Quincey Morris
On Oct 5, 2010, at 02:48, Derek Huby wrote: > This method isn't doing what I expect it to do (which probably means that I'm > expecting the wrong thing.) > > //= > NSRange range = NSMakeRange(0,1); > > NSString *s1 = @"ab"; > NSString *s

Re: Not understanding NSString's compare:options:range:locale: method

2010-10-08 Thread Aki Inoue
Hi Derek, The range argument only applies to the receiver of the message. So, with your first example, you're comparing @"a" against @"ac". Aki On 2010/10/05, at 2:48, Derek Huby wrote: > This method isn't doing what I expect it to do (which probably means that I'm > expecting the wrong thing.

Re: Not understanding NSString's compare:options:range:locale: method

2010-10-08 Thread Stephen J. Butler
On Tue, Oct 5, 2010 at 4:48 AM, Derek Huby wrote: > This method isn't doing what I expect it to do (which probably means that I'm > expecting the wrong thing.) > > //= > NSRange range = NSMakeRange(0,1); > > NSString *s1 = @"ab"; > NSString *s2

Re: Problem using dictionary

2010-10-08 Thread Quincey Morris
On Oct 8, 2010, at 04:47, Remco Poelstra wrote: > Is there a reason valueForKey: is documented directly but valueForKeyPath: is > not? They're both documented, but it requires familiarity with how to read the Cocoa documentation, which is an important point that goes beyond just this example.

Return value of performSelector:onThread:?

2010-10-08 Thread Abhi Beckert
Hi, I have a background thread which needs the main thread to create an object (because part of the initializer isn't thread safe). The performSelector: methods don't expose the return value of the message, even with waitUntilDone:YES. I'm not happy with my workaround, which is to use an insta

create multiple Custom Views

2010-10-08 Thread N!K
I know this should be really easy, but I've been unsuccessful finding an explanation or tutorial in Apple's documentation or in Google. A couple terse examples did show up, but I did not understand them or they didn't seem to apply. In simplest form, I need to put two Custom Views onto the one w

Not understanding NSString's compare:options:range:locale: method

2010-10-08 Thread Derek Huby
This method isn't doing what I expect it to do (which probably means that I'm expecting the wrong thing.) //= NSRange range = NSMakeRange(0,1); NSString *s1 = @"ab"; NSString *s2 = @"ac"; //Just compare the first character NSCo

confused about floats

2010-10-08 Thread Amy Heavey
I've got two float values (x and y) that I'm using to change the coordinates of a drawing action that is being looped through. I can add a value to x and it draws the next image along, but I want to test the value of x and if it is out of bounds I want to reset it to zero and increase y, so

Re: [iPhone] Changing iPhone Application Language Programatically.

2010-10-08 Thread Jeff Kelley
Tharindu,     We had to do something similar and decided to eschew .lproj files entirely; we simply created an ivar in our app delegate to store the current language and switched out strings (stored in strings files) based on the current language. There’s no reason you couldn't do the same in your

Re: Release autoreleased object now

2010-10-08 Thread Kyle Sluder
On Oct 8, 2010, at 9:58 AM, Jonny Taylor wrote: > The problem is coming from OS functions such as [image TIFFRepresentation] > that return autoreleased objects, so it is obviously considered ok to > autorelease large chunks of memory. My question is whether I can tell the OS > to release the m

Release autoreleased object now

2010-10-08 Thread Jonny Taylor
Is there a way of forcing an autoreleased object to be released right now? I am encountering problems in my image processing code where I am receiving (and later discarding) a lot of large blocks of autoreleased memory in a loop. This is not getting cleaned up until the end of the loop (when I d

Question about MPMusicPlayerController

2010-10-08 Thread Eric E. Dolecki
I have an app I am playing around with to play my music on my Touch. When I select a genre that is in a table, I construct a query to get all the tracks for that genre, start that queue, build UI in a scrollview. However if I choose a Genre like "Rock" that is available and has a lot of tracks in

Where is SimpleTextInput sample code project?

2010-10-08 Thread Ross Carter
Text and Web Programming Guide for iOS (http://developer.apple.com/library/ios/#documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/CustomTextProcessing/CustomTextProcessing.html) says: "The code was taken from the SimpleTextInput sample code project." Does that sample code project exi

Re: Problem using dictionary

2010-10-08 Thread Remco Poelstra
Ah, I should use valueForKeyPath:. Is there a reason valueForKey: is documented directly but valueForKeyPath: is not? Kind regards, Remco Poelstra Op 8 okt 2010, om 13:34 heeft Remco Poelstra het volgende geschreven: > Hi, > > I've the following code: > > NSDictionary *dict=[[NSDictionary al

Problem using dictionary

2010-10-08 Thread Remco Poelstra
Hi, I've the following code: NSDictionary *dict=[[NSDictionary alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Indexes" ofType:@"plist"]]; //This is actually a global initialized in +initialize. NSString *key=[NSString stringWithFormat:@"%...@.%@",page,property]; NSLog(@"

Re: Calling maincontroller

2010-10-08 Thread Hans van der Meer
On 7 okt 2010, at 22:13, Quincey Morris wrote: > On Oct 7, 2010, at 11:58, Hans van der Meer wrote: > >> In my application I instantiate a MainController (the delegate having >> "awakeFromNib) from where all actions are dispatched. In order to send >> messages to the displaywindow residing in

Re: init returns nil or raises exception?

2010-10-08 Thread Remco Poelstra
Op 8 okt 2010, om 09:57 heeft Kyle Sluder het volgende geschreven: > On Fri, Oct 8, 2010 at 12:04 AM, Remco Poelstra wrote: >> Ah, I see. I hoped it was 'the new way to go'. I like to more than checking >> for nil, but I might be a bit lazy :) > > Checking for nil and assigning to self should b

Re: init returns nil or raises exception?

2010-10-08 Thread Kyle Sluder
On Fri, Oct 8, 2010 at 12:04 AM, Remco Poelstra wrote: > Ah, I see. I hoped it was 'the new way to go'. I like to more than checking > for nil, but I might be a bit lazy :) Checking for nil and assigning to self should be reflexes. You can combine the two if you like. Whenever I write an -init me

Re: init returns nil or raises exception?

2010-10-08 Thread Remco Poelstra
Op 7-10-2010 18:12, Jean-Daniel Dupas schreef: Le 7 oct. 2010 à 18:04, Kyle Sluder a écrit : On Thu, Oct 7, 2010 at 12:47 AM, Remco Poelstra wrote: While still in the process of cleaning up my code, I read in the documentation of NSObject that -init should return nil if it fails to initiali