Problem using NSURLRequest to POST data to server

You should remove the leading & in myRequestString and the problem is likely that the correct content-type header is not being sent. Try adding a call to [request setValue:@”application/x-www-form-urlencoded” forHTTPHeaderField:@”content-type”]; You should also not pass nil for error, so you can see what the client thinks is going on. Unrelated, but your PHP code is … Read more

difference between presentViewController and UINavigationController?

presentViewController offers a mechanism to display a so-called modal view controller; i.e., a view controller that will take full control of your UI by being superimposed on top of a presenting controller. UINavigationController offers a much more flexible mechanism where you can push a new controller, and later pop it, so to go back to … Read more

how to increase font size in UIWebView

I have 2 buttons – A- and A+ @interface NSUInteger textFontSize; – (IBAction)changeTextFontSize:(id)sender { switch ([sender tag]) { case 1: // A- textFontSize = (textFontSize > 50) ? textFontSize -5 : textFontSize; break; case 2: // A+ textFontSize = (textFontSize < 160) ? textFontSize +5 : textFontSize; break; } NSString *jsString = [[NSString alloc] initWithFormat:@”document.getElementsByTagName(‘body’)[0].style.webkitTextSizeAdjust=”%d%%””, … Read more

Xcode error ‘building for iOS Simulator, but linking in dylib built for iOS .. for architecture arm64’ from Apple Silicon M1 Mac

Answering my own question in a hope to help others who are having similar problems. (and until a good answer is added from another user) I found out that GoogleWebRTC actually requires its source to be compiled with x64 based on its source depo. For builds targeting iOS devices, this should be set to either … Read more

Refresh UIPageViewController – reorder pages and add new pages

I found a workaround to force UIPageViewController to forget about cached view controllers of neighboring pages that are currently not displayed: pageViewController.dataSource = nil; pageViewController.dataSource = self; I do this everytime I change the set of pages. Of course this doesn’t affect the currently displayed page. With this workaround I avoid the caching bug and … Read more

Using MD5 hash on a string in cocoa? [duplicate]

Noticed this in the Facebook Connect source code. Looks pretty solid, give it a shot. #import <CommonCrypto/CommonDigest.h> … + (NSString*)md5HexDigest:(NSString*)input { const char* str = [input UTF8String]; unsigned char result[CC_MD5_DIGEST_LENGTH]; CC_MD5(str, strlen(str), result); NSMutableString *ret = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH*2]; for(int i = 0; i<CC_MD5_DIGEST_LENGTH; i++) { [ret appendFormat:@”%02x”,result[i]]; } return ret; } …

Subview appears underneath superviews layer.border?

According to the Apple specification: It is composited above the receiver’s contents and sublayers. So, the border will always be above of all your subviews, even if you bring your subview to the front and so on. So I make a background view to fake the border. E.g.: UIView *backgroundView = [[UIView alloc] initWithFrame:CGRectMake(100, 100, … Read more