objective-c

Accessing the navigationController from a 'push'ed viewcontroller?

I've got a main menu using a UITableView which can successfully push and display other ViewControllers to the fore. However, within these pushed controllers I wish to be able to push other controllers onto the navigationController stack. self.navigationController in a pushed ViewController seemingly does not reference anything, so when I...

How to load a UIView from a NIB?

I have been using UIViewControllers and initWithNibName with much success, basically using them as a convenient way to design the view with Interface Builder. Unfortunately I have built a hierarchy of views before noticing this line in the UIViewController documentation: Note: You should not use view controllers to manage views th...

Simple CalendarStore query puts application into infinite loop!?

Hi, I've been looking at adding iCal support to my new application and everything seemed just fine and worked on my Mac OS X 10.6 Snow Leopard development machine without a hitch. Now it looks like depending on what is in your calendar the very simple query below: - (NSArray*) fetchCalendarEventsForNext50Minutes { NSLog(@"fetchCalend...

On a Mac how to determine a user logout is occuring

Hello All, I am very new to the Mac platform and Objective-C in general and in my application I would like to know how to determine that a user is logging out and perform some actions prior to this. Any info or pointers for this will be greatly appreciated. Regards, -Jim ...

UIDatePicker locale does nothing?

I'm creating a UIDatePicker programmatically, and setting its locale with the following code: datePicker.locale = [[[NSLocale alloc] initWithLocaleIdentifier:@"es_ES"] autorelease]; The datepicker still appears in English (or whatever language I've set the phone to). Anyone have any idea why this does nothing, or how to fix it? ...

Objective-C static analysis tools -- plugin to Xcode?

Are there any tools out there for Objective-C / Xcode? Something that can do one or more of the following: Detect unused imports Auto-synthesize properties Autogenerate dealloc method from retained properties Provide method stubs for interface ...

Change the state of a customized button (button with an image)?

I know how to change the state of the regular button, as well as change the background color of a regular button. However, when I do UIButton:setBackgroundImage (customized button), then I cant change the state anymore. I want, when the user click on it, something visually would happen to let the user know that button is selected, and wh...

What does the 'a' prefix represent in aString?

I'm just looking at NSString.h and wonder why some method declaration args use (NSString *)string; while others use (NSString *)aString. What are the conventions practiced here? Thanks for any insight. ...

Detecting/Repairing NSConnection failure

I would like to use NSConnection/NSDistributedObject for interprocess communication. I would like the client to be able to handle the case where the server is only occasionally reachable. How can I determine if sending a message to the NSConnection will fail or has failed? Currently if my server (the process that has vended the remote o...

NSArray/NSMutableArray : Passed by ref or by value???

Totally confused here. I have a PARENT UIViewController that needs to pass an NSMutableArray to a CHILD UIViewController. I'm expecting it to be passed by reference so that changes made in the CHILD will be reflected in the PARENT and vice-versa. But that is not the case. Both have a property declared as .. @property (nonatomic, ret...

Compile OpenSSH for use in iphone application

I am trying to create an application to take advantage of OpenSSH to create an sFtp client for the iphone. I know that it is possible to create ssh clients for iPhone (iSSH, TouchTerm, etc) and I also assume they are using openssh as a base. Would I just need to create a static library? ...

Objective-C and use of SEL/IMP

Another question of mine about optimizing Objective C programs inspired the following: does anyone have a short example using SEL and IMP when theMethod has two (or more) integers for input? ...

How do I use a modalViewController Identically in Two Controllers?

I'm using the Three20 TTMessageController in my app. I've figured out how to use it, adding on a bunch of other stuff (including TTMessageControllerDelegate methods and ABPeoplePickerNavigationControllerDelegate methods). It works great for me, after a bit of a struggle to figure it out. The trouble I'm having now is a design issue: I w...

How to call a method when the Done Button in the KeyBoard is Clicked?

I want to call a method when the done button is clicked in the UITextField KeyBoard? Please Help me... ...

Threading questions

If I spawn a secondary thread and the threaded method calls other methods, are those methods run in the secondary thread or the main thread? Is there a way to determine on which thread a specified piece of code is being run? ...

How to sort an NSMutableArray List of names in alphabetical order in objcetive -c?

Hi Guys, I need to display the list of names which are getting from the parser. I am getting the nsmutable arrary of list, then i need to display them in alphabetical order please provide solution. Thank you, Madan Mohan. I tried which you have given NSArray *myArtistArray=[[NSArray alloc]init]; myArtistArray=[artistsList sort...

Re-usable Obj-C classes with custom values: The right way

I'm trying to reuse a group of Obj-C clases between iPhone applications. The values that differ from app to app have been isolated and I'm trying to figure out the best way to apply these custom values to the classes on an app-to-app basis. Should I hold them in code? // I might have 10 customizable values for each class, that's a lon...

How to pause recording using AudioQueues in iPhone ?

Hi All, I am using AudioQueue for recording voice. I want to know how can we pause the recording ? Thanks ...

Record/Playback with AudioQueue on iPhone

Hi, I am currently using Audio Queues on the iPhone to record and playback audio. What I would like to be able to do is to record some audio, allow the user to pause the record queue, and to seek back and forward through the audio to select a position from where they can start recording from again. I have got over the seeking issue by...

dismissing modalViewController all view move up by 20px

here i am using presentModalViewController and dismissModalViewController with animation set to "YES" in both cases. Which works fine. However, after the modal view is dismissed, all of the content on the main view has moved up what looks like 20px.Its effect all the viewcontroller. Any idea why did it happen and how to overcome it. ...