I want to display data loaded from a webservice but the webservice is taking a long time and the "data" is being displayed before it is loaded. How may I force it to wait?
Thanks.
Connection to web service
NSMutableURLRequest *theRequest=[NSMutableURLRequest requestWithURL:tmpURl];
[theRequest addValue:@"text/xml; charset=utf-8" forH...
NSMutableString *str = [[NSMutableString alloc] init];
Suppose str has right know a value "me".
And On click of a button I want that the value of str get reset. That is the string value become nil or empty.
now i am using this [myword stringWithString: @""]; but not working.
...
Hi,everyone,
I use the following code to set the retrieve the phone number in my app.
CFStringRef addressBookMobile;
ABRecordRef person;
NSString *mobile;
person = CFArrayGetValueAtIndex(people, i);
addressBookMobile = ABRecordCopyValue(person, kABPersonPhoneProperty);
mobile = [NSString stringWithFormat:@"%@", addressBookMobile];
T...
Is there any way to specify if current thread is main thread or not in objective-c?
I want to do something like this.
- (void)someMethod
{
if (IS_THIS_MAIN_THREAD?) {
NSLog(@"ok. this is main thread.");
} else {
NSLog(@"don't call this method from other thread!");
}
}
...
Hi,
Is there some way to get UIKeyboard size programatically. 216.0f height and 162.0f height in landscape.
Following seem to be depricated. Is there some way that works without any warning in both 3.0 iPhone OS SDK and 4.0 iPhone OS SDK to do this..
CGSize keyBoardSize = [[[note userInfo]
objectForKey:UIKeyboardBoundsUserInfoKey]CGR...
Hi
I have developed an iphone application which has 6 cards (icons with images) in the Rootview. Clicking on a card would bring another view which the image being enlarged (fullScreen). The Card View has a Flip button which shows the back side of the Card which contains some text. Different cards hold different text on their back. Depen...
I can't understand the logic og button tags. Can someone tell me how to use button tags?
For eg. There are two buttons on my view and I want to print something depending on their tags like:
if(button.tag==???)x{
}etc.
...
Hi all,
I am facing a strange problem with CTFrameGetLines( frameRef ) method of Core Text API. I am getting an array of all CTLines that are present in a frame using function
CFArrayRef lines = CTFrameGetLines( frameRef );
and then I am calculating no. of lines that are present using
linesCount = CFArrayGetCount (lines);
In...
When running the following prepare statement for a SQLite3 db-selecct query I get a SQLLite Error 21 "Library routine called out of sequence":
sqlite3 *lDb;
sqlite3_stmt *lStmt;
NSNumberFormatter *lNbrFmt = [[[NSNumberFormatter alloc] init] autorelease];
// Define SQL statement
NSString *lSql = @"SELECT secti...
Hi
i'm developing a messaging iphone application,i need to show the messages in same way how sms are showing in iphone,can any one give me a clue on that, i mean what sort of component need to use.
Please refer to attach image.
Thanks,
Sam.
...
Hi - I'm writing a native iPhone app that contains a UIWebView component. This component accesses an internet webapp and the webapp stores data offline using HTML5 local storage.
Is it possible to access this local storage data from the native app ?
...
I want to add element in the array dynamically. For this I am using
[myArray addObject:myword];
myword is a NSMutableString type object.
on each button click myword get changes. But all the element of array store the last value.
Suppose first time the array has 1 element = "me"
Second time array should have 2 element = "me", "you". ...
Hi
I'm trying to add a shadow to a uitabelviewcell using the layer.shadowColor, Offset, Radius but it doesn't seem to affect it in anyway. The table is grouped style. Any ideas why?
Here is the code i'm using:
cell.layer.shadowColor= [UIColor blackColor].CGColor;
cell.layer.shadowRadius = 5.0;
cell.layer.shadowOffset = CGSizeMake(10, ...
I want to have my iPhone application create a PDF file and store it in an appropriate place - probably the iBooks folder so it can be easily retrieved using iTunes, but that's a change for later once I have the saving part working. I've followed the PDF saving tutorial on the Apple site to the letter, including swapping out CGContextBegi...
Hi everyone,
I am using MFMessageComposeViewController to send sms within my app. Everything is correct until i try to get the result of the operation. Actually the Message sending failed as It can be seen in the SMS native app (I have no service in the sim card), but I get MessageComposeResultSent in - (void)messageComposeViewController...
Is there any way to change the image of the reorder control that is displayed when the UITableView is in edit mode? I have a UIImage that I’d like to display instead of the usual grey bars.
Do I have to subclass UITableViewCell to accomplish this?
...
Lately, I have received a text from the QA folks saying that the developed app's orientation is incorrect on iPhone 3, while it can display correctly on iOS 4. They say on iOS 3, the app's orientation is on portrait view, which makes the app leaving gray space below. However, they claimed that on iOS 4, the orientation is correct.
I te...
So,
Now the time has come to go back over an old iPhone project to localise it and I am confronted by ploughing through an entire project looking for user facing strings. Is there any crafty way of doing this short of searching for @" and checking every instance?
Looking at the Apple localization documentation there does seem to be ment...
Is there any ground rule for using methods like drawRect, setNeedsDisplay and layoutSubViews?
I believe they adversely affect the app performance. Is there any preferred alternatives for these messages?
...
Hi All,
I am loading new views for a small iphone app, and was wondering how to pass details from one to another?
I am loading a tableview full of data from and xml file, then once clicked a new view is brought in via:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
SubInfoViewControll...