Questions tagged as 'objective-c'

1
answer

Formatting Decimal

I'm having a problem decimally formatting my code in Objective-c, I'd like to take advantage of only 2 decimal places of my variable that is float . Ex: Variable value discount = 4.00043621 I need to be stored only 4.00...
asked by 21.08.2015 / 14:50
2
answers

How to use the AFNetworking 2.0 library synchronously?

I would like to call a rest service using the AFNetworking library. How to make a call synchronously, ie wait for the return of the webservice? For example: Method that will return a carriage object: Carro *carro = [self findCarro...
asked by 15.02.2014 / 22:17
1
answer

How to generate a random number within a range?

Using the arc4random_uniform() method, how should I assemble the logic to generate a random within a given range? For example, given the range [5, 10] Random Candidates:    5, 6, 7, 8, 9, 10     
asked by 20.03.2015 / 21:05
2
answers

Testing asynchronous requests

How can I make asynchronous requests in iOS TestCases? Example: -(void)test { UserModel* user = [UserModel sharedInstance]; [user requestUserInformationWithCompletion:^(NSError* error, NSDictionary* info){ if(error) {...
asked by 11.02.2014 / 16:55
1
answer

Load WebView in Objective c

I set up a builder interface to load a webview, with .h, .m, and .xib. In a side menu, when I click on an option, I need to call this webview. Running the application, clicking this option returns the error "Thread 1: SIGABRT signal" in main.m....
asked by 04.05.2017 / 14:19
1
answer

How to configure predicate to return only 2 columns?

Scenery: Do a query using CoreData looking for records with a city and state, and return only the 'name' and 'address' columns of the location. I'm currently using the following query: // Array to be returned NSMutableArray* arrayRegi...
asked by 11.10.2015 / 16:45
1
answer

How to access PHP webservice securely from an Objective-C / iOS application?

I'm making an application where I need to securely send user data to the Web Service using PHP. For this, I'm researching about security for iOS. What is the recommended method and what are the points that I should be concerned about? Plea...
asked by 30.03.2015 / 03:17
1
answer

UITableView with custom and scalable UITableViewCell

I'm creating a chat for IOs in Objective C, and I use custom UItableViewCell. My difficulty is to resize the Cell as the text in the chat, like the image: Andthissecondscreen,ishowitis,withoneconversation,overlappingtheother,withouthavingali...
asked by 11.01.2016 / 16:26
1
answer

Loop does not run in Xcode

I'm trying to run a loop in Xcode , however it does not work. The console is:    Type the loop number:   5 Nothing else happens in the terminal. There is no 0.1,2,3,4,5. In short, it gets stuck after I type any number, bu...
asked by 30.04.2014 / 23:10
3
answers

Rotation on certain screens

How do I set only a UIViewController to be enabled in rotation? The scenario is as follows:    I have 5 screens, and in all of them I should only enable the mode   portrait. But I have a sixth screen, and it must be enabled   the la...
asked by 16.12.2014 / 17:27