iphone

iPhone SDK shake and vibrate

hi guys ... how can use vibrate when iPhone shaking ? here is my code : #pragma mark - - (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration { { if (acceleration.x > kAccelerationThreshold || acceleration.y > kAccelerationThreshold || accelerati...

Dependency Injection framework for the iPhone

I was wondering if there were any dependency injection frameworks for use with development on the iPhone. Being a Java developer by day, I enjoy, and see the benefits of, frameworks like Spring. You can go part of the way by manually making certain components singletons and tying up the references manually. ...

iPhone: Reachability for wireless where actual internet is not needed

Anyone have an idea on how I could check for a wifi connection where I don't necessarily need to connect to the internet? I've implemented wifi multiplayer in a game I'm working on, so I want to make sure and let the user know if there's no connection when they are trying to use that mode. The Reachability sample code seems to only wor...

iPhone trial period for app

I need to implement trail period in my app. How to do it? Store day count in NSDefault? or some other? ...

iphone sqlite NSDate bug

Hi, i use core data in my iphone app, but in some case i use sqlite to access to data and ia have a problem with NSDate. NSDate *now = [NSDate date]; NSCalendar *calender = [NSCalendar currentCalendar];; NSDateComponents *comp = [calender components:NSYearCalendarUnit fromDate:now]; [comp setDay:1]; [comp setMonth:1]...

How can I create a custom "pin-drop" animation using MKAnnotationView?

I have an instance of MKMapView and would like to use custom annotation icons instead of the standard pin icons supplied by MKPinAnnotationView. So, I've setup a subclass of MKAnnotationView called CustomMapAnnotation and am overriding -(void)drawRect: to draw a CGImage. This works. The trouble comes when I try to replicate the .animate...

Using the netinet functions on iPhone causes the UI to not refresh

I'm including the netinet headers and doing some raw socket programming on the iPhone, and have found when making these calls, the UI won't refresh until I'm finished- any response I get and write to the UI, isn't written until the IBAction that made the call is complete. Using performSelector with a delay, I've been able to work around ...

iphone Development - adding a loop?

Hello,i need help create a loop that check if the item selected in the array is already picked before, if yes randomize it again. implement in this function: -(NSString*) randomBallPick:(NSString*) Filename { NSMutableArray *imageArray = [[NSMutableArray alloc] init]; for (int c=0;c<37;c++) { NSString *imageName = [NSSt...

iphone Development - analyze error

NSString *temp = [self randomBallPick:temp]; the following error: Pass-by-value argument in message expression is undefined why? -(NSString*) randomBallPick:(NSString*) oneFilename { //create an array of filenames NSMutableArray *imageArray = [[NSMutableArray alloc] init]; for (int c=0;c<37;c++) { NSString *imag...

Finding memory leaks while running iPhone unit tests.

I know how to do Unit Test on iPhone - the logic tests which run during build phase of the "iPhone Unit Test Bundle". I know how to detect memory leaks using instruments - in XCode, Menu->Run->run with perf tools->Leaks. How do I do both? I want to run the unit tests and detect memory leaks in them. If I try to simply select unit-test ...

iphone tableviewcontroller left/right slide when switching views programmatically?

To explain what I'm trying to do: I have a navigationController with a list of options, clicking one will do the usual push of the selected TableViewController subclass, sliding the screen to the left, displaying the usual "back" button and view title on the top. so far so good. This view is showing content for a specific day. Lets c...

Signer not valid error

I've created an ad hoc build of my app and would like another person to install it. I have their device ID (two actually) in the provisioning profile. My certificate is the same for ad hoc and app store provisioning. The certificate is valid in keychain. I've selected the ad hoc profile in Xcode for this build, which is linked to the...

Playback MP3 using RemoteIO and AudioUnits on iPhone... possible?

I want to playback an mp3 rather than an uncompressed file using RemoteIO / AudioUnit. Using uncompressed files obviously uses far too much disk space (30MB vs 3MB for mp3). Is this even possible? If so, can you provide a little code headstart? Thanks a million. ...

Determine the app IDs of applications on iPhone

Does anyone know how to programmatically determine the application IDs of the apps on an iPhone? I.E. to determine what applications have been installed on an iPhone? ...

Serializing objects in Objective C

When a user uploads something via my app, I create an ASIFormDataRequest object to make the POST. When the user is offline, I would like to write a ASIFormDataRequest object to file and send it later. Is there a built in way to serialize an object like this in Objective C, or do I have to write something from scratch? ...

How can I send two arguments in a selector method?

In the following, how can I send two arguments in togButton method? I tried, but it did not work. [button addTarget:self action:@selector(togButton:) forControlEvents:UIControlEventTouchUpInside]; ...

How can I create and maintain authentication sessions on an iPhone?

HI, i am about to create an iphone application that will have a account system . ( login/logout ) . that will have a server side also. so how to do session management. while your client is iphone how i can do that ?? ...

how to set the style of the TableView to "UITableViewCellStyleSubtitle".

how to set the style of the TableView to "UITableViewCellStyleSubtitle". so that i can use it to display as sub title in UITABLE ...

identifying Button selection of each row in Tableview?

hi,i coded like - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; btn.frame = CGRectMake(230.0f, 4.0f, 60.0f, 36.0f); [btn setTitle:@"OK" forState:UIControlStateNormal]; [btn setTitle:@"OK" forStat...

mapViewDidFailLoadingMap delegate method gets called with error == 0

In my viewcontroller, I create a MKMapView object. I set the delegate to self, and in the ViewController, I implemented: - (void)mapViewDidFailLoadingMap:(MKMapView *)mapView withError:(NSError *)error This method gets called, but in the debugger, I see that error has the value 0x0 This happens on the device, and in the simulator. ...