iphone

alternate of sleep command in x code - iphone developement

I have implemented following in my application. for(i=0;!stopThroughButtons && i<totalMovements;i++){ [NSThread detachNewThreadSelector:@selector(moveNeedle) toTarget:self withObject:nil]; sleep(0.3); } Here sleep is a function with argument of unsigned int type. Sleep method uses seconds to sleep. I want to give the timing in ...

Using NSScanner to identify characters in NSString

Hi, newbie here...I'd like take my input which is an NSString and use NSScanner to identify and act upon the characters typed. I've taken another example i've found and modified it however need more help. For example: NSString *yourString = @"Hello"; // For example NSScanner *scanner = [NSScanner scannerWithString:yourString]; NSChara...

CoreData add[ttt] vs set[ttt] - difference in to-many relationship?

With a one-to-many relationship: the generated classes from the xcdatamodel will have: @interface Department (CoreDataGeneratedAccessors) - (void)addEmployeeObject:(Employee *)value; - (void)removeEmployeeObject:(Employee *)value; - (void)addEmployees:(NSSet *)value; - (void)remove Employees:(NSSet *)value; @end Would 'addEmployees' r...

[iPhone SDK] What is the best way to store Text Messages? Something like SMS

Hi, I´m writing a small prgramm in which the User is able to send small Messages (460 Characters). Now I want something like a History in which the user can see all Messages he ever send from this App inlucing the recipient and the Text, both are Strings. Is Core Data "to much" for this? Any other Idea? Thank you twickl ...

iPhone: How do you control UITextView's link color when phone number/email is recognised?

I have a UITextview that has a phone number in it. I see when it detects it it turns it the standard link blue and underlines it. I just want to know how I can control that link state programmatically. ...

Is there a way to pop a view controller when the user switches tabs?

Is there a way to pop the view controller when the user switches tabs? I have a tabbar with a navigationController on one of the tabs. The user selects a row in a table which pushes a viewController onto the navigationController containing the table. Then the user switches tabs to a new view. In the new view he hits a button that b...

for loop execution doesn't permit touches on iPhone.

Ok. I know the title may be confusing. Logic That I have implemented is something like this. There is an detector in application ( like bike speedometer - moving arrow ) When user taps start scan button - first method executes. NowStartMovements decides random rotations & random number to stop There are 1 to 10 numbers on detector. Ev...

How can I play a sound on the iPhone using MonoTouch?

I am looking for something like PlaySound (uint frequency) Does it exist? ...

Cross iPhone communication using mono touch

Does mono touch allow you to do cross iPhone communication? (iPhones in the same room) If so, what's the API? ...

Couple of problems when going nibless on UIKit

I'm trying to go nibless on the "View Switcher" program from Beginning iPhone Development and I'm running into a couple of problems. Here's the source code. 1) The first time I switch to the "yellow" view the button kind of "slides" in. 2) The view doesn't fill up the whole screen. Basically, I just have a BlueViewController and a Yel...

How can I preserve views and controllers across restart of an application in iPhone?

Hello all, I am building up a game and want to give user a continue functionality when he restarts the application. So I want to know how to code or what to do to start an application where it left last time. Is there any sample code available in app center which explains how can this be possible. Tnx in advance. ...

How can I shrink the size of my mono touch application

I created a simple hello world mono touch (iPhone) application. However, its size is 5MB. Is there a way to make it smaller? ...

Getting error as sigabart error on iPhone with the compiled statement.

I am preparing sqlite statement and while preparing this statement my code is breaking.I am using following line of code if (sqlite3_prepare_v2(database,getCC , -1, &getConsumptionCount, NULL) != SQLITE_OK) { NSAssert1(0, @"Error: failed to prepare for getConsumptionCount statement with message '%s'.", sqlite3_errmsg(database)); ...

Must I retain the date from a UIDatePicker Modal View?

I'm getting crashes from my UIDatePicker view and I think it's because I'm not retaining the pickers selected date. Can anyone tell me if this could be correct? I have a modal view for selecting a toDate and a fromDate range. These values are passed into the modal view and grabbed out of the view when it's dismissed. The view has one UI...

How do you pass a float to ProgressView from another class?

I'm trying to pass ProgressView a float from a calculation made in another class. I've tried passing it by converting it to a NSDecimalNumber but I can't get it back to a float again when it reaches the destination. There's got to be a better way than this. ...

Setting an image for a UIButton in code.

Hi, How do you set the image for a UIButton in code? I have this: UIButton *btnTwo = [UIButton buttonWithType:UIButtonTypeRoundedRect]; btnTwo.frame = CGRectMake(40, 140, 240, 30); [btnTwo setTitle:@"vc2:v1" forState:UIControlStateNormal]; [btnTwo addTarget:self action:@selector(goToOne) forControlEvents:UIControlEventTouchUpInside];...

how to get country location on Google Map in iphone using Country name only?

Hi, In my iphone application i have integrated Google Map.I want to show the country location on Google map using only country Name Only.(Not needed to use its latitude and longitude).The input only will be the country name?(i.e India) to the google Map and Map will locate it with indicate pinpoint. Is it possible to locate the country...

iphone: Calculating battery life

Wondering if there are references beyond the Apple tech stats for calculating battery life. I've tried comparing some existing battery apps (battery % left * Apple's figures) and I dont come up with the same answers sometimes. Also there are stats for using 2G cell (as opposed to 3G) and I dont see anything on Apple for 2G battery life. ...

iPhone, special characters in JSON Response

Writing an iphone app, and I'm getting my data from a REST API that returns JSON. My problem is, some of the data has special characters embedded and Im getting errors. Example: MartÌn Petite-RiviËre-Saint-FranÁois Here is my current code: NSString *jsonString = [[NSString alloc] initWithData:receivedData...

how to pen Iphone .plist file in Windows Machine?

In my Iphone application i have .plist file in which i am putting all the Input data. I will further use this data in the code: directly from .plist file. The problem is that when i am going to open the .plist file in a windows machine, it is not showing its original content. It is just showing the Binary characters or junk characters. ...