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

How to make my 'click' function work with iOS

I have a set of Div’s which act as buttons. These buttons have a simple jquery click() function which works in all browsers except iOS. For example: <div class=”button”>click me</div> and $(‘.button’).click(function(){ alert(‘hi’); }); I’m not sure why this doesn’t work on iOS – clearly there is no ‘clicking’ in iOS. Unfortunately I don’t have […]

iOS – Scale and crop CMSampleBufferRef/CVImageBufferRef

I am using AVFoundation and getting the sample buffer from AVCaptureVideoDataOutput, I can write it directly to videoWriter by using: – (void)writeBufferFrame:(CMSampleBufferRef)sampleBuffer { CMTime lastSampleTime = CMSampleBufferGetPresentationTimeStamp(sampleBuffer); if(self.videoWriter.status != AVAssetWriterStatusWriting) { [self.videoWriter startWriting]; [self.videoWriter startSessionAtSourceTime:lastSampleTime]; } [self.videoWriterInput appendSampleBuffer:sampleBuffer]; } What I want to do now is to crop and scale the image inside the CMSampleBufferRef […]

Best practice using NSLocalizedString

I’m (like all others) using NSLocalizedStringto localize my app. Unfortunately, there are several “drawbacks” (not necessarily the fault of NSLocalizedString itself), including No autocompletition for strings in Xcode. This makes working not only error-prone but also tiresome. You might end up redefining a string simply because you didn’t know an equivalent string already existed (i.e. […]

How do I set the height of tableHeaderView (UITableView) with autolayout?

I’m been smashing my head against the wall with this for last 3 or 4 hours and I can’t seem to figure it out. I have a UIViewController with a full screen UITableView inside of it (there’s some other stuff on the screen, which is why I can’t use a UITableViewController) and I want to […]

Smart-search for Parse Usernames in Swift not working

I’m trying to have a smart-search in my iOS app so that when a user types a character into a UISearchBar, the results automatically update in the tableview below the searchbar. For some reason, the searchBar function with textDidChange isn’t called when I type a character into the search bar. It’s called after 2 characters […]

Converting NSData to NSString in Objective c

I want to convert NSData to NSString..What is the best way to do this? I am using this code but the final string returns null NSString *str = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; NSLog(@”%@”,str); When I see console It will print null.

Xcode 6: Keyboard does not show up in simulator

Keyboard does not show up when I run the simulator, and then click in the UITextView. How do I re-enable the keyboard? It used to work but now it doesn’t – I don’t know what I might have clicked on accident… any tips would be appreciated!

iOS9 getting error “an ssl error has occurred and a secure connection to the server cannot be made”

Since I upgraded to Xcode7, when I run my existing project with iOS 9, I keep getting the error : An SSL error has occurred and a secure connection to the server cannot be made.

POST request with a simple string in body with Alamofire

how is it possible to send a POST request with a simple string in the HTTP body with Alamofire in my iOS app? As default Alamofire needs parameters for a request: Alamofire.request(.POST, “http://mywebsite.com/post-request”, parameters: [“foo”: “bar”]) These parameters contain key-value-pairs. But I don’t want to send a request with a key-value string in the HTTP […]

Handling private frameworks in Xcode ≥ 7.3

With Xcode 7.3 / iOS 9.3 Apple removed all private frameworks from the iOS SDKs. For research purposes (not App Store!) I need to work with a private framework (namely BluetoothManager.framework, but this is also an issue for any other private frameworks). Because these frameworks are no longer delivered in the iOS SDKs, I get […]