iOS Development is easy with XCode, Swift3, UITableView, cocatouch, let's build iPhone, iPad and Macbook Applications.

Unwanted scrolling when animating zoomScale in UIScrollView

Executive Summary: At times UIScrollView makes an unwanted change to the value of contentOffset, thus causing the app to display the wrong location in the document being viewed. The unwanted change happens in conjunction to an animated change to the scroll view’s zoomScale. The Details: I’m having trouble when zooming out with CATiledLayer in a […]

optimized way to search a device ip address within a range in iphone

I have situation where-in i have to search IP address of **router ** and I know only it’s range is from range to I know this is not good way to search. for i in 1… 255 { var str = “163.289.2.” + “i” var tempIP = Ping.getIPAddress(str) if(tempIP == true) { break; […]

how to send audio file through http post to a server from ios?

i have two function recordsound and post this recorded sound to the server. this is the following code i used to post to the server NSString *filePath = [[NSBundle mainBundle] pathForResource:@”recordedTmpFile” ofType:@”caf”]; NSURL *file =[[NSURL alloc] initFileURLWithPath:filePath]; NSString *filepath = [[NSBundle mainBundle] initWithContentsOfURL:recordedTmpFile]; NSData *postData = [NSData dataWithContentsOfFile:filePath]; //nsdata to string NSString* newStr = [NSString […]

didSelectRowAtIndexPath selecting more than one row at a time

I have a UITableView populated with 27 rows. I am trying to change the accessoryType of the selected cell. I do that in the didSelectRowAtIndexPath: delegate method. The problem I am facing is that, when selecting a row and changing the accessoryType of the cell, the eleventh row from that row also gets modified. I […]

Tap pressure strength detection using CPBPressureTouchGestureRecognizer

it’s working great with one UIButton: – (void) viewDidLoad { [super viewDidLoad]; CPBPressureTouchGestureRecognizer* recognizer = [[CPBPressureTouchGestureRecognizer alloc] initWithTarget:self action:@selector(A_button:)]; [A_button addGestureRecognizer: recognizer]; [recognizer release]; } – (void) A_button: (CPBPressureTouchGestureRecognizer*) recognizer { [pan_A setGain:recognizer.pressure]; [pan_A] play; } i tried to use more but only the second one is working: – (void) viewDidLoad { [super viewDidLoad]; CPBPressureTouchGestureRecognizer* […]

Why do Objective-C APIs return implicitly unwrapped optionals?

I am rather perplexed by this. If we take the method cellForRowAtIndexPath: in UITableView for example, it’s method signature is: func cellForRowAtIndexPath(_ indexPath: NSIndexPath!) -> UITableViewCell! And its return value is: An object representing a cell of the table or nil if the cell is not visible or indexPath is out of range. That sounds […]

Localize Localizable.strings with Xcode 4.5

Possible Duplicate: Localization – Add additional language to localizable.strings file With Xcode 4.5 SDK iOS 6.0, I cannot add localization to Localizable.strings file. In Xcode 4.4.1- under the list of all added languages was a “+” to add other languages. But in Xcode 4.5 I can’t see it and I can’t add any other languages […]

Detect whether browser has keyboard/arrow keys in web page

I have a full-screen game in HTML+JavaScript, which uses the arrow keys as primary controls. This cannot be used on keyboardless Android devices (I haven’t tested on iOS), and even if the soft keyboard had arrow keys it would take up unnecessary space. Therefore, I have added onscreen control buttons. However, the buttons are unnecessary […]

Data encryption with Core Data in iOS

I just need a confirmation on this. Is it correct to say that, with the iPhone 3GS and above, any data written to the filesystem is encrypted using hardware encryption? By simply creating the XXX.sqlite file on the file system, the data stored in it is already encrypted. Also for further security NSFileProtectionComplete is provided? […]

Consuming SOAP web services on iOS

I am trying to write applications for iPad which take advantage of web services. I know the concept of a web service and have used it in C#/.NET. I need to know how to do this on an iPad. Can anyone recommend a good book or reading material on webservices for iOS?