cocoa-touch

Object life after death (retain count = 0)

I just noticed this in some code that's been working for months. Though it makes me curious I'm sure we've been living on borrowed time... Assuming activeItem: @property (nonatomic, retain) ItemView *activeItem; And we have this conditional in touchesEnded: if (CGRectContainsPoint(dropRect, touchLocation)) { ItemView *replacemen...

Is there anything like viewDidLoad for the loading of the app's main xib?

As in the one defined with "Main nib file base name" in the app's Info.plist. Should I just use applicationDidFinishLaunching? ...

It's working only on simulator, but isn't working on Device

Hi everybody, I'm working on sample project for learning core animation. I have problem with my device, I wrote simple project and it's conatins just one viewcontroller and this viewcontroller's view contains just two layer, each layer have .png image backgrounds (actually 700 x 700 px) and these images contains semi transparent content...

NSOperation for drawing UI while parsing data?

Hi, Hope you guys can help me :) In the main thread, I create a NSOperation and add it to a queue. What that operation do is connect to a data server with NSURLConnection, save the receivedData and parse it. Operation.m - (void)start { NSLog(@"opeartion for <%@> started.", [cmd description]); [self willChangeValueForKey:@"i...

parse string with tags

Hi all, I am receiving a chunk of data from PBX in string with tags included. Something like this: </response><rid>2</rid><name>2101<name><PeerList></PeerList><status>UNKNOWN</status> cont...till it fetches all the names/users from the PBX. what i need to do is to parse this string data to retrieve name & status and update i...

How to pass parameters through IBAction in iPhone SDK?

I am developing for iPhone the app I am developing has many buttons and I want all buttons to call the same method but with different parameter for example I want button1 to call the method mymethod with the parameter "foo" and button2 should call the same method but with parameter "bar" Thanks for help ...

Setting IBOutlet to nil

Quick question, are these the same? self.sliderLabel = nil; AND [self setSliderLabel: nil]; gary ...

NSURL's parameterString confusion with use of ';' vs '&'

I'd like to use NSURL's parameterString method to parse out the parameters of a URL I've been passed. It says URL must conform to RFC 1808 but now wondering if ours do?!? We use something like: http://server/path/query?property1=value1&amp;property2=value2 but RFC 1808 never mentions the ampersand (&) as a valid parameter separator (...

Asp.net msbuild application

How can i get the detailed errors of the build project? You give just whether the project successfully build or not.. ...

Where does UIApplication's handleOpenURL 'Return' to exactly?

I'm working on a handling a custom URL Scheme in an app and am trying to sort out: - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url I'm passing and successfully parsing a URL into an NSDictionary in my app but wondering "what now?" handleOpenURL returns a BOOL but to what? It's hard for me to debug as I hav...

Call instance method from class method

Hi dudes, and dudetts! So I need to call some instance methods from class methods in objecitve-c... Example : +(id)barWithFoo:(NSFoo *) { [self foo]; //Raises compiler warning. } -(void)foo { //cool stuff } So my question; StackOverFlow is how do you do such things in Objective-C, I'm new kinda to OOP, so am I mad, or is there a ...

How do I really know when a UIButton has been released?

I'm running into an issue where I have a UIButton in which I want to track press/release events. So I am tacking on to the Touch Down/Touch Up events. Unfortunately, in certain situations this won't track Touch Up events -- for instance, if an Alert pops up. - (IBAction)buttonDown:(id)sender; - (IBAction)buttonUp:(id)sender; How do I ...

Fade from iPhone default bitmap into main app

What's the easiest/fastest/most efficient way to perform a gradual (0.5 sec) fade from Default.png to the initial app view? My initial try, which doesn't work so well .. it's Saturday night, let's see if we can do better :) UIImageView* whiteoutView = [[UIImageView alloc] initWithFrame:self.view.frame]; // dealloc this later ?? whiteou...

Creating and canceling an NSURLConnection

I have a NSURLConnection that is working fine when I allow the load to complete. But if the user hits the back button, meaning the webview will dissappear, I want to cancel the NSURLConnection in progress. But if have the webview call into this class when viewWillDissapear is called, and then I do: [conn cancel] I get an NSINValidArg...

Filling a Nav Bar with an image

I want to completely fill a nav bar with my own image. The image I created is 44 by 320 pixels, which I believe is the size of the nav bar. I use the code below to put the image in the nav bar. This works fine, but the image does not completely fill the space. It is filled vertically, but there are a few pixels on each side (both left ...

Add a button in a UITableViewCell when UISearchBar has no results (like Mail app)

I want to mimic the behavior of the Mail app when no results are found from the UISearchBar, and show a cell with a link to call a method. I can't figure out (or find anywhere) how to do so. The closest I think I've come is the following (which I've added into my code) if ([self.keys count] == 0){ [self.tableView beginUpdates]; ...

iPhone Application crashes in "AdHoc" mode

Hi guys, i got a little application which is working very well with my "debug" configuration on my phone and in simulator. i created a adhoc provisioning profile, and added a "beta" configuration to it. trying to launch the application with the ad-hoc configuration crashes my application immediatelly. the console output is: Running…...

Switching Views within UITabBar View

Hello, I have created an UITabView application. Each view selected from the bar is a seperate controller with own nib file. I switch between them succesfully. In the first view I have two buttons (check out the screenshot). When clicking them I want to switch to another views which are the parts of the current view controller. I use: ...

concurent background donwloads on iphone

Hi there! I am trying to create class that will handle multiple downloads at same time (I need to download a lot of small files) and I have problems with "disappearing" connections. I have function addDonwload that adds url to list of urls to download, and checks if there is free download slot available. If there is one it starts downl...

Why can I not receive touch events within my custom UIScrollView subclass?

i have an uiscrollview with a uiimageview inside. I subclass the uiscrollview but i can not get touches to work touchbegin does not called. What should i do to call uitouch event? what is wrong? .h #import <UIKit/UIKit.h> @interface myScrollView : UIScrollView { } @end .m #import "myScrollView.h" @implementation myScrollView ...