iphone

What system does before launching iPhone app's main() function?

My app takes too much time to loading. So I put a NSLog in main() function like this to measure loading time from first: int main(int argc, char *argv[]) { NSLog(@"main"); NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; int retVal = UIApplicationMain(argc, argv, nil, nil); [pool release]; return re...

How do I not override old drawings in my iPhone app?

Hi guys, I'm trying to make a "MSPaint" app in iPhone. I am trying to use circles to draw solid circles (which i've done successfully), and then build an eraser by drawing transparent circles. Can someone help me out here? I am kind of stuck. Thanks guys. #import "ImageView.h" #import "EraseViewController.h" @implementation ImageVie...

How do I remove a child later? (cocos2d)

I added a child like this inside of a CCLayer: [self addChild:object1]; Later on I want to remove that object from the children. Ummm so how do I do that? Thanks. ...

view .txt, .pdf files in iphone

Hi friends, I am getting the data of the file from network and receiving it in NSData(not saving it any were). I want to view the files without saving it anywere. I tried it with UIWebView but with no success [webView loadData:data_ MIMEType:@"text" textEncodingName:@"UTF-8" baseURL:nil]; Any hint in right direction would be highly ...

touchesMoved QuartzDemo application

I am modifying the QuartzDemo application to include swipe detection while UIView is active (a PDF page being displayed in it via Quartz). This will not work, the event never gets to the QuartzView.m because it sits under scrollview? touchesBegan works fine and I can use single tap. How can I go about with catching touchesMoved while ...

Create NSString from strings within a dictionary

I have an NSDictionary where both the keys and values are NSStrings and I'd like to create one NSString from them in the form of Key1: Value1 Key2: Value2 What is the best method of doing this? ...

Public class: The best way to store and access NSMutableDictionary?

I have a class to help me store persistent data across sessions. The problem is I want to store a running sample of the property list or "plist" file in an NSMutableArray throughout the instance of the Persistance class so I can read and edit the values and write them back when I need to. The problem is, as the methods are publicly defi...

iPhone - Separated UINavigation Bar Items

Is there an existing API for this kind of separated controls for the UINavigationbar seen in Mail.app? More specifically this up and down arrows shown in the picture. ...

urllib alternative for iPhone

hi, I am trying to create an iPhone application which in some point connects to the internet, fills an on-line form, fetches the resulting website, parses it and returns a string to the user. I want all this process to happen in the background. I know how to do this kind of things with python and urllib but in objc I can't find an altern...

Where can I get a list of abbrvations for timeZoneWithAbbreviation?

I'd like to do some timezone calculation, using the following API: NSTimeZone *some_time_zone = [NSTimeZone timeZoneWithAbbreviation:name]; however, I am not sure where to find the supported list of abbreviation names. For example, what is the name for the timezone of Siena Italy? ...

CGPath and Quartz 2D

I want to create a triangle using Quartz 2D functions. The 3 edges of the triangle should be in different colors. I am able to create the triangle but not able to set the color of each edge or subpath separately. Any suggestions or sample code are much appreciated. ...

What is the correct way of handling a reloaded view after it was dismissed?

Hi, I have the same problem as the guy here: http://stackoverflow.com/questions/2682844/uiimagepickercontroller-reloads-view-after-its-dismissed I have a UIView with a UIDatePicker within a Popover. When the Popover is dismissed and presented again, it sometimes resets the Picker in the view because hidden views are unloaded when a mem...

Objective-C++ visibility question

I have linked a library with my program. It works fine. The only problem is that there visibility errors/warnings (thousands of them). They are all of the form: newlib::method() has different visibility (default) in newlib.a and (hidden) in AppDelegate.o It is always with AppDelegate.o. I have tried to set the visibility for both the...

How to establish a socket connection from iPhone to a Apache server and communicate via PHP?

Hi, I am working on an iPhone game which is depended on a LAMP server. I want to create a "event" based system where the apache server sends an event to the iphone. For this, I am thinking of using "CFStreamCreatePairWithSocketToHost" to connect to port 80 of the apache server. I am able to successfully connect to the server and open...

UIViewController is popped from view stack and NSURLConnection crashes the application

I am pushing a UIViewController onto a UINavigationController. This view controller immediately starts a download of an xml feed and then parses it. However, if you hit the back button before it is done downloading, and crashes with EXC_BAD_ACCESS. The line that is crashing it is in parserDidEndDocument and is this line: if (self.del...

How to group two CABasicAnimation animations and kick them off at the exact same time?

I know there is some kind of animation grouping mechanism in core animation. So lets say I have two CABasicAnimation firstAnimation and secondAnimation. How would I group these and how would I kick off the group to start animating? ...

How to animate the frame of an layer with CABasicAnimation?

I guess I have to convert the CGRect into an object to pass it to fromValue? This is how I try it, but it doesn't work: CABasicAnimation *frameAnimation = [CABasicAnimation animationWithKeyPath:@"frame"]; frameAnimation.duration = 2.5; frameAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInE...

iPad App Cookies Storage?

Hi, I have an application that sends you to one website that shows a login form. I've read up on cookies from the apple reference (http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSHTTPCookie_Class/Reference/Reference.html#//apple_ref/occ/instm/NSHTTPCookie/initWithProperties:) I'm honestly ju...

How to make a CAShapeLayer throw a shadow in iPhone OS 3.0 ?

I'm using a CAShapeLayer with a path. Now I want it to throw a smooth shadow with about 10 units of thickness. First: Yeah, I could create just 11 CAShapeLayer objects and each time increase the outline of the path by 1 unit with an different color and some more alpha on every iteration. But this way I blow up my memory footprint since ...

Erase operation in quartz 2D

Any suggestions on how to perform erase operations in Quartz 2D? ...