objective-c

uiview loading other views.

I have a .h file containing... myViewController : UIViewController {} in the .m file I need to load either another view or a tab view depending on choice of the user. Does anyone have a good example that I can borrow and learn from ?? thanks!! ...

retaining when returning?

Should I be retaining the responseData that I am returning // METHOD -(NSData *)dataFromTurbine:(NSString *)pathToURL { NSURL *url = [[NSURL alloc] initWithString:pathToURL]; NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url]; NSHTTPURLResponse *response = nil; NSError *error = nil; NSData *responseData ...

Working with NSCalendar -- getting the next first tuesday of a month

Hi all, This is a bit odd, but is it possible to use an NSCalendar (or any component, for that matter) to figure out what the date of the next "first tuesday of the month" would be? For example, today is Thursday March 25, 2010. The next "first tuesday of the month" would be on April 6. Likewise, if I were looking for the next "first...

Futures for Objective-C?

Has anyone implemented Futures in Objective-C? I (hopefully not naively) assume that it should be reasonably simple to wrap NSInvocations in a nice API? ...

How to do a login screen?

I have this working but I don't think it is working correctly so I just wanted to get your feedback. I am trying to display a screen that has two buttons - one that takes you to a login screen and the the allows you to register. II am testing in the appDelegate if they are logged in and if they aren't I am showing the signLogIN view....

Adding Existing Framework to Xcode (iPhone) error

I have added the <QuartzCore/QuartzCore.h> to my Frameworks folder in my iPhone project and added the #import "<QuartzCore/QuartzCore.h>" statement at the top of a custom UIView class. However the custom UIView class gives me a "No such file or directory" compliation error in relation to the <QuartzCore/QuartzCore.h> framework. Is ther...

Tilde in device name causing problems with NSOutputStream socket

In the networking between the iPhone and desktop versions of our application, the iPhone sends over the device name for use on the desktop. The problem is that some of the beta testers have tildes (`) in their device names. For some reason when this is in the device name it prevent the socket from sending the actual string data. I've tr...

Return Selected Phone Address from iPhone Address Book

Hey, I found a tutorial online that extends that Apple QuickStart Application which is the basic Address Book Application and another that returns the first phone number regardless of what phone number was clicked. I want to display only the selected phone number in the label. The label is called phoneNumber: - (BOOL)peoplePickerNaviga...

How to access a variable's value from one class, if the variable is defined in another? (Objective-C)

I have two pairs (.m and .h) of files. In one's interface section, I've defined a global BOOL variable. I need to get it's value in another class. How can I do it? (I can't make one class a subclass of another). In one file I have @interface TabBarRotation : UITabBarController { BOOL portrait; } @end @implementation TabBarRota...

NSURL from NSURLConnection?

It seems dead simple, as to create an NSURLConnection I usually do this: NSURL *theURL = [NSURL URLWithString:urlString]; NSURLRequest *req = [NSURLRequest requestWithURL:theURL]; NSURLConnection *connection = [NSURLConnection connectionWithRequest:req delegate:self]; But how can I get the URL back in the delegate methods? Short of ha...

How do I package an SDK (static lib + xibs) for the iPhone?

I am creating an SDK for a client that includes predefined view controllers. What is the recommended way to package everything (static lib, .xib(s), and .png(s)) for easy use? SDKs that I've used (e.g. Pinch Media) do a good job of just providing a .h and .a file that expose only user accessible functionality and hiding everything else....

Netflix OData API iPhone: Accessing more than just the title

Netflix just recently announced that they have a new OData API which gives developers access to more of their catalog and is exactly what I've been looking for. Also, on odata.org they have a sample iphone objective-c sdk that accesses the netflix odata api and displays a few movie titles in a tableview with a navigationcontroller. http...

How to get iPhones current orientation?

Is there a special method to get iPhones orientation? I don't need it in degrees or radians, I want it to return an UIInterfaceOrientation object. I just need it for an if-else construction like if(currentOrientation==UIInterfaceOrientationPortrait ||currentOrientation==UIInterfaceOrientationPortraitUpsideDown) { //Code } if (current...

get type of NSNumber

I want to get the type of NSNumber instance. I found out on http://www.cocoadev.com/index.pl?NSNumber this: NSNumber *myNum = [[NSNumber alloc] initWithBool:TRUE]; if ([[myNum className] isEqualToString:@"NSCFNumber"]) { // process NSNumber as integer } else if ([[myNum className] isEqualToString:@"NSCFBoolean"]) { // process...

Forwarding Class Messages

I know that I can forward messages to instances of a class using -forwardInvocation:. Can I do the same for messages sent to a class object (as in +forwardInvocation:)? ...

Objective-C NSArray NEWBIE Question:

Hi I have a weird problems with NSArray where some of the members of the objects in my array are going out of scope but not the others: I have a simple object called Section. It has 3 members. @interface Section : NSObject { NSNumber *section_Id; NSNumber *routeId; NSString *startLocationName; } @property(nonatomic,reta...

How to merge two FBOs?

OK so I have 4 buffers, 3 FBOs and a render buffer. Let me explain. I have a view FBO, which will store the scene before I render it to the render buffer. I have a background buffer, which contains the background of the scene. I have a user buffer, which the user manipulates. When the user makes some action I draw to the user buffer,...

How to open a document using an application launched via NSTask?

Hello world, I've grown tired of the built-in open Mac OS X command, mostly because it runs programs with your actual user ID instead of the effective user ID; this results in the fact sudo open Foo opens Foo with its associated application with your account instead of the root account, and it annoys me. So I decided to make some kind o...

How can I find out if an external headset is connected to an iPhone?

I wonder if it's possible to detect that the user has an external headset plugged into the iPhone's 3.5mm connector or the 30-pin connector. I want to output audio only to an external audio device, and keep silent if nothing is connected. Ari. ...

Is there any problem for loading images more than 200 from resource folder?

My application contains more than 200 images each with size approx. 15 KB. I want to flip these image one by one. Is there will be any time lag for loading images? Is there any alternate method for doing that? Anyone please help! ...