Zero JSON result after analysis

I am trying to extract the value from a JSON serialization but getting nil as the result. App was working under Swift2 so its the conversion to Swift 3 where the issue started. let jsonResult = try JSONSerialization.jsonObject(with: data!, options: .

React Native - Can not call the method of another component

I have two very simple classes. All I am trying to do is call a method from another component that will print text to the console. When the user clicks the navigate button in class 2, it should call the _printtest function in class 1, unfortunately,

Xcode bug after a crash

While I was creating a build to test on my iPhone xcode 8 crashed, when I re-opened xcode all of a sudden this error came about from no where. Command /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool failed with exit code 255. The tool may h

how to truncate text in UILabel

I have problem with truncation of text in UILabel even I have set lineBreakMode = NSLineBreakByWordWrapping perfectly. Here is my code snippet : lblSelectedText = [[UILabel alloc] init]; lblSelectedText.numberOfLines = 0; lblSelectedText.lineBreakMod

Swift: Deleting master data, the table will not be updated

This code seems to be deleting the actual data ok however the table doesn't update without the row unless I force close the app and reopen. Thanks in advance. import UIKit import CoreData class ViewController: UIViewController,UITableViewDataSource,U

Automatic layout problem

I have a UIButton inside a UIView sitting at the bottom of a UITableView (outside and after the tableViewCell), with the following constraints: The result looks like this: I can't figure out these: How can I add extra space between the last cell and

How to call the CoreMotion authorization sheet again

I have been using some CoreMotion (pedometer) data in an app that I am writing. Early on I granted the app permission to the data and everything is working well. Now I am going to write the part that asks the user for permission but since I have alre

Errors while retrieving all Parse data from a class

I am retrieving multiple items from Parse and would like to loop through them and add them to an array. Below is my code. I have several errors: Cannot invoke append with an argument list of type '(String)' Argument for generic parameter 'T' could no

Push multiple view controllers into the storyboard

I have three controllers (FriendVC, ChatVC, PrivateChatVC) inside storyboad, and navigation is sequential : A user can navigate from FriendVC to ChatVC(in TabBarController), and then to PrivateChatVC. Now, I need to make some button that will open Pr

How to set the camera view to fill its parent view

I don't know if this problem is something about auto layout or I am doing something wrong. I have a UIViewController and one UIView inside of it. And I am using AVCaptureSession to put camera view inside of it. Problem is that when I camera view load

NSInvocation gets target causing EXC_BAD_ACCESS

I have a weird problem with NSInvocation. I'm using it as a return callback when a network operation completes. Let me explain the previous sentence in more detail: I'm using a custom made network protocol which works over a TCP socket and I have a c

Erase the drawing made on the image

So, I am working on a virtual wall painting app. I am able to draw some random lines by moving my finger on the image view(which has an image in it). Now I am trying to erase the drawings made on it without success as of yet. I googled to find some s

PushViewController does not grow after rejecting ViewController

I am developing iPhone app, where i got stuck at one point. The error i am facing is, i have one presentViewController on which i have one button, on click of that button i am dismissing my presentViewController and after dismissing i want to push My

Objective-C Create an instance of ViewController

I wanted to create an instance of the ViewController class with : ViewController *viewConnection = [[ViewController alloc]init]; self.image.center = CGPointMake(self.image.center.x + 1, self.image.center.y); if (CGRectIntersectsRect(self.image.frame,

Basic Tips on Memory Leaks in Custom TableViewCells

I'm really struggling to understand memory leaks from a custom tableViewCell in an ARC-based project and was hoping someone might be able to shed some light on if the following might be responsible or if I'm barking up the wrong tree entirely. So, I'

Getting the limits of a UIView compared to the window?

I have a few UIButton instances inside a UIView, which in turn is inside the main UIView of the app. What I'm trying to get is a CGRect of one of the buttons' frames, relative to the window. So, for instance, if my inner view is at 50, 50 in relation

The urban airship crashes calling for takeoff

Upgrading to UrbanAirship 3.0.0 with Xcode 5.0, I'm getting an error when calling this code: [UAirship takeOff:config]; The error is +[NSJSONSerialization stringWithObject:]: unrecognized selector sent to class 0x3b2ca9fc 2013-09-19 15:02:31.981 [178

UIButton is 0x0000 when reloading TableView in ios

I added UIButton to each uitableview row but when i nedd reloadData, uibutton is 0x0000. Can you give me any suggestions? Thanks much. I used this code: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)inde

Asynchronous Requests / Answers: When did I really finish?

This is a design pattern question. Imagine a programming task where one is developing a client that will interact with a server asynchronously (via streams). Let's say the challenge is to execute an indeterminate number of tasks, each of which may sp

In general, invokes and @selector is it slow?

When creating an iOS program is there any performance hit if I pass around SELs (@selectors) and invoke them in other classes? Is this significantly slower than normal method invocations?Why would there be a performance hit for messaging (the one thi

Instantiate a particular number of a sprite

In my game, I need to instance a certain number of sprites depending on my game's level. That number of sprites is stored in a .plist file. The way my game works is that it selects a random type of enemy for that one particular level. Then, it goes a

Dynamic button selection

Suppose I have two buttons that are ivar outlets. One is called "Blue" and the other "Red." Now, I have an NSString with the value of "Red." I want to set the button identified by the NSString to a selected state, without usi

iOS - CFSocket does not receive a reminder

Similar questions have been asked, but problems seem to be very code specific, so hopefully this is OK. I am trying to write an iOS application which listens for UDP broadcasts and acts on the data. More advanced implementations seem to suggest using