objective-c

Smooth transition to "full screen" when using UISearchDisplayController

To explain what I'm looking for I'll give an example: In the Contacts app, when you click the Search field in the first row of the table view it will smoothly take over the entire screen (minus the status bar) including the Navigation Controller's title bar. Edit: I've also realized that I'm pretty sure this is related to the UISearchDi...

How to clear a dictionary?

I'm currently doing the following to clear out an NSMutableDictionary [myDictionary release]; myDictionary = [[NSMutableDictionary alloc] init]; The release line doesn't actually release any objects in the dictionary. I can still see all of them on the next line. It isn't until the alloc line is executed that the dictionary is zeroed...

Obj-C Function Parameters

How can I send parameters to my function? - (void)alertURL { NSLog(@"%@",url); } - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url { alertURL(url); return YES; } If there is anything else wrong, please tell me :) ...

Is it possible to cache web pages with a UIWebView?

I have an app that contains a UIWebView. I would like the user to be able to view webpages they've previously navigated to when off line. How should I go about making this work? Thanks! ...

Objective-C Alert .. not working?

For some reason my alert is not working? If i use NSLog(@" %@ ", url) its fine... but no alert here: - (void)alertURL:(NSURL *)url { UIAlertView *someError = [[UIAlertView alloc] initWithTitle: url message: @"Error sending your info to the server" delegate: self cancelButtonTitle: @"Ok" otherButtonTitles: nil]; [someError show]; [someE...

Hiding TabBar within a UINavigation Screen Causes 20 Pixel Shift of the Screen in iPhone SDK 3.1

Gentlepeople, I'm a newbie to iPhone & Objective-C, coming from a long background of procedural language. I'm attempting to emulate the functionality of the Whole Foods' recipe search. In that app, the screen has a NavigationBar at the top, a TabBar at the bottom, and a grouping of three buttons toward the top of the screen. Selecting...

Objective-C, How can i get the value of a UITextField?

How can i get the value of a UITextField? Some sample code to attach it to an NSString would be fab! P.S - Happy New Year! ...

Passing integer by reference

I have a class level int defined in my header file. In the .m file, I have a method that I'd like to take an int parameter, modify it and have the modified value reflected at the caller. For example: classLevelInt = 2; [self someMethod:classLevelInt]; //Here, I'd like classLevelInt to equal the value assigned to it in the method In...

UIPickerView - Selects row too fast.

I am currently using a UIPIckerView in my app to allow a user to select from a list of options. The problem is that there isn't enough of a delay when the user stops spinning the wheel and it is selecting a value before the user has a chance to scroll further down the list. Is there a way to override the default behavior that selects t...

Does GCC have a GUI?

Does GCC have a GUI or Graphical IDE? Edit: I'm on Windows Vista /7 OR Ubuntu 9.10. I'm looking for something beginner-friendly. I've used Flash CS3 for 2 years and been doing HTML for 6. I have toyed briefly with Java and once or twice tried C++. I prefer working on Windows for now. ...

Detect CPU Architecture (32-bit / 64-bit) runtime in Objective C (Mac OS X)

I'm currently wring a Cocoa application which needs to execute some (console) applications which are optimized for 32 and 64 bit. Because of this I would like to detect what CPU architecture the application is running on so I can start the correct console application. So in short: how do I detect if the application is running on a 64 bi...

Objective-C, Set UITextField Value from this:

Hi, I have been told that to access a UITextField in the setup i have with my app, i have to use a subView whatever this is (in a noob at objectivec) and i was given this [subview isKindOfClass:[UITextField class]] Where do i put this? And how can i use it to set the value of my UITextField? :D Thanks! Update: I want to set the valu...

Multithreading and "just leaking" warning

I'm creating a new thread like this: [NSThread detachNewThreadSelector: @selector(myMethod:) toTarget:self withObject:filePath]; and in the method I do: - (void) myMethod:(NSString*)path{ NSAutoreleasePool *pool = [NSAutoreleasePool alloc]; [UIImagePNGRepresentation(theImage) writeToFile:[path stringByAppendingString:@".png"] atomic...

Objective-C: When to know that you are abusing the SIngleton method of Global Variables.

So my clients iphone app has balloned from 5 or so classes to over 25 in the last few weeks. With such a large (for the iphone anyway) class structure I've been utilizing the Singleton class for accessing global variables. The problem is that whenever I need to access a variable outside of the class I'm working on, I have a choice of e...

Submitting a Form to a Web Server using NSUrlConnection

What's the quickest or best way to create and submit a form to a remote web server (http) using NSUrlConnection? I assume I can build the form in Interface Builder, but I'm clueless as to where to go from there, even though I've read several resources on both (including the docs). Just not sure how to put two-and-two together. ...

Calling -init multiple times in Objective-C

What happens when you call -init multiple times on one object, are there some hidden side effects? Can you assume that no additional memory is allocated? Would anything go against such an idea? ...

Drawing/Rendering a UIView Within a Separate Thread so NSTimer Always Fires Timely

I'm using a NSTimer to fire a drawRect within the app's main view. The drawRect draws a few images, and blends each using kCGBlendModeScreen (which is an absolute must). However, the drawRect takes just a tad longer than desired, so the timer doesn't always get fired at the desired rate (more like half as often). I've optimized the grap...

Custom NSWindow drawing

I want to draw an NSWindow that looks similar to this: http://vibealicious.com/site/apps/notify/screenshots/mainUIFull.png In that it has a typical NSWindow appearance with the bottom bar and such, but instead of a title bar at the top, I want to draw a little arrow. Is there a simple way to do this? Do I have to draw the entire wind...

Best approach for one view to call a tabbed view on iPhone

EDIT Let me simplify the question: Suppose your application has two views, the home view and a tabbed view with 3 tabs. The home view has three standard buttons named "Tab1", "Tab2" and "Tab3". When you click on "Tab1", the tabbed view should be opened with tab 1 selected and the same goes for Tab2 and Tab3. Any hints? /EDIT What I'm ...

help understanding typedef struct

i come from a php background and am studying this page http://cocoadevcentral.com/articles/000081.php before i step foot into some of the harder stuff in regards to objective-c if i type something like this typedef struct { int lengthInSeconds; int yearRecorded; } Song; and when setting a function or a variable of type Song, what...