Questions tagged [ios]

184763 questions
1

votes
3

answer
380

Views

Sorting NSDocumentDirectory by name

I want to sort all NSDocumentDirectory by fileName but folders should be first by name and then all files are sorted by name. In my Document Directory, i have lots of files and folders also. i have the array like, _filePathsArray =[[NSFileManager defaultManager] contentsOfDirectoryAtPath:_selectedPa...
Apple
1

votes
3

answer
478

Views

Get NSManagedObject attribute validation regular expression

In my data model, some of the attributes have regular expressions used for data validation. There are places in my code that I would like to use those same regular expressions. In the interest of keeping my common regular expressions in one place, I was hoping either to set these regexes in code or...
Aaron
1

votes
4

answer
437

Views

UITableView dynamic size

In my main view I have a header (label) and footer (button). In the middle there is a table. Table takes data from MutableArray so number of table items is different each time. Before and behind a table I have some vertical spaces (set by constraints) because I want to have some space between header...
DanielH
1

votes
1

answer
1.3k

Views

CFNotificationCenterAddObserver No matching function for call error

I am writing a jail break tweak. I am hooking to all apps including app store based apps. I need to write a file to capture some data. Based on this answer, best way is for all apps to send notification to SpringBoard and let SpringBoard write file to /var/mobile/application. But I am not able to co...
Jailbroken
1

votes
1

answer
2.1k

Views

change only a border color in UIPopoverController using custom UIPopoverBackgroundView

I know that there are several similar questions and there are several tutorials on this subject(like this one : http://blog.teamtreehouse.com/customizing-the-design-of-uipopovercontroller). But my need is just to change a popover border color, and it seems like it's not possible to do it without cha...
pvllnspk
1

votes
3

answer
1.5k

Views

Need to enable UITextField in row of UITableView when cell is selected in iOS

I have created a custom cell that places a UITextField in each row of a UITableView. What I would like to do is enable the UITextField for a particular row (i.e. activate the cursor in that textfield), when the user presses on anywhere inside the cell. I have the following method where I try to do...
syedfa
1

votes
3

answer
1.2k

Views

detailtext label not showing up

When I am using the snippet below, the detail text label does not show up: -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString* cellIdentifier = @"NEW"; [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:ce...
newbie
1

votes
3

answer
1.8k

Views

Animate UILabel in UITableViewCell

I have a custom UITableViewCell with three labels - title, subtitle and right detail. Now when a User taps on Cell this Cell becomes checked with the normal Checkmark, but I need to animate the right label to the left. I thought I could just do CGRect rect = cell.playerRatingLabel.frame; rect.origin...
user1396236
1

votes
1

answer
683

Views

Geographic coordinates to screen coordinates algorithm

I'm developing a cross platform mobile application that stores positions as geographic coordinates into a db, each of these points represent the top left corner of a graphical object. This application contains a map control (radmap from telerik), that supports geographic coordinates, so, you just ad...
lpinho
1

votes
4

answer
1.9k

Views

Get clicked linked on uiwebview navigating on m.youtube.com on ios

I use uiwebview on my ios application. I have textbox above it and it navigates the uiwebview. I enter m.youtube.com and the webview perfectly loads it. I made a search on the youtube.com and the results is loaded perfectly. When I click any of the video I go to the video page, and I want to have th...
Bilgin Kılıç
1

votes
1

answer
1.8k

Views

Access audio buffer of an AVAudioSession

Hope this question makes some sense, I'm completely lost.... In my proto-app I'm recording micro input and saving it, and so far no problems at all. I now need to access the buffer while I'm recording it in order to pass chunks of data to another class (written in C, not by me) that will do some ana...
Sr.Richie
1

votes
1

answer
1.9k

Views

How to update CollectionView's numberOfItemsInSection after block finishes executing

I would like to put up a UICollectionView of pictures downloaded from a backend provider, and am running the issue where every time my collection view controller is initialized, the required method - (NSInteger) collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)sect...
daspianist
1

votes
4

answer
1.5k

Views

Is it possible to send data between two apps running on the one iPad

I'm wondering if it is possible to have two apps running on my ipad where one is sending data to the other with the latter updating it's information based on the data it has received from the first app. Please note I don't care too much about battery longevity or anything like that. I'm just trying...
N0xus
1

votes
2

answer
333

Views

Call method only once every app launch

Hey guys at Stackoverflow! I need your help. I am looking for a way to call my method only once after the application has launched and "save" the state of the color of the UIView. At first I will show you my code, that I can explain it in a better way: -(void)viewWillAppear:(BOOL)animated { NSArray...
MasterRazer
1

votes
2

answer
534

Views

How to sort NSArray of custom objects by a specific property in descending order?

How do I make this piece of code to order in descending order. This code always gives me the array in ascending order: NSArray *sortedProductsByStyle = [unsortedProducts sortedArrayUsingComparator: ^(Product *p1, Product *p2) { return [p1.productStyle compare:p2.productStyle options:NSNumericSearch]...
Renexandro
1

votes
2

answer
1.5k

Views

Checking for duplicate events without getting all events in the Event Store in IOS

I am adding array of events to IOS calendar.As it has to happing on clicking a button.By doing this all the events are getting added again and again.So to over come that I used NSPredicate to get all the events and doing validation like below NSDate *edate=[formatter dateFromString:startDateString]...
iSwaroop
1

votes
1

answer
1.1k

Views

Change position of UIView doesn't work

I have a UIView and I would like to move it up by 50. I wrote the following: NSLog(@"before %@",NSStringFromCGRect(_flixSuggestionsView.frame)); _flixSuggestionsView.frame = CGRectMake(_flixSuggestionsView.frame.origin.x, _flixSuggestionsView.frame.origin.y-45, _flixSuggestionsView.frame.size.width,...
Dejell
1

votes
1

answer
924

Views

I want to draw a Smooth animations in iOS using CAPropertyAnimations

it works like this I want to show a circle animation. it become bigger gradually. I don't want to change it's position. my code is as following, and the circle's position also moves, how can deal with this. - (void)viewDidLoad { [super viewDidLoad]; int radius = 20; CGPoint drawPoint = CGPointMake(s...
bohan
1

votes
1

answer
2.4k

Views

setting ui slider values programmatically

I am working from a template project and I now have to add a uislider, I want to be able to programatically program the values from my ui slider from a class that is already set up called Price delegate. When I'm researching this I keep coming back with JQuery? can I only do it using jQuery? I nee...
Sophia Matarazzo
1

votes
1

answer
764

Views

Restoring In-App purchases

I'm creating a game where the player can buy non-consumable items, there are 10 to buy and once bought they stay bought. The transactions for these items (a simple boolean for each item) is recorded on a server (Parse.com). So I'm unsure what I need to do with my restore button as it doesn't matter...
Phil
1

votes
2

answer
1.8k

Views

image upload using AFNetworking, ios

I have to upload image to server by sending bytes of photo and I'm using AFNetworking, but I keep getting this error- Error: Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (JSON text did not start with array or object and option to allow fragme...
user2769614
-2

votes
1

answer
38

Views

I have been facing this issue couldn't figure out.its giving me error “Extra argument 'method' in call”

func registerUser(email : String , password: String , completion : @escaping ComplitionHandler) { let lowercaseEmail = email.lowercased() let header = [ "Content-Type": "application/json; charset=utf-8" ] let body : [String: Any] = [ "email" : lowercaseEmail, "password" : password ] AF.request(Regis...
Ahmed Fayyaz
1

votes
1

answer
29

Views

Reusing JSONDecoder or recreating it on every request?

In an asynchronous environment is it more efficient to use one JSONDecoder for all request (Might result in delays if multiple threads are waiting for the lock) or it's more efficient to create a new JSONDecoder for every new request? Apple documentation says that the JSONDecoder class is reusable...
l.vasilev
1

votes
2

answer
340

Views

How to change color of view fade in CATransition

I'm implementing a custom CATransition so I can presentViewController from the left or right instead of the bottom, but am encountering an interesting issue with what the CATransition does. Here is my code: let transition:CATransition = CATransition() transition.duration = 2 transition.timingFuncti...
Unome
2

votes
0

answer
69

Views

How To Configure React 360 for Google Cardboard

I'm doing some tests with React 360 and the only hardware I have at the moment is a Google Cardboard. I'm using VR Browser on iOS to view the content I've uploaded and it's working, but the stereoscopic image seems to be too far apart resulting in a "seeing double" effect. The canvas object also doe...
Cmaxster
0

votes
1

answer
53

Views

SDK DJI download photo in swift

I am simply attempting to download the latest access the feed from my DJI drone and convert the feed into a UIImage. The easiest way i thought this could be done is take a photo, then promptly afterwards download the latest photo from the storage. I will add the download from storage code below. Is...
Sam
0

votes
0

answer
3

Views

iOS IAP not working on Unity, “Service Unavailable”

I'm trying to test IAP of my game in Unity 3D but it doesn't work, it woks fine on Android but when I test it on iOS it said: Service Unavailable, please check your internet connection. This is the log: AdMob client has been initialized. EasyMobile.AdClientImpl:Init() EasyMobile.Advertising:SetupAdC...
Youssef
0

votes
0

answer
4

Views

How to integrate Google Tag Manager to Xamarin.Ios?

I'm working on a xamarin.forms project and I want to send the firebase events to google analytics through GTM. I have integrated firebase and also crrated the google tag container in firebase sdk. Also, added container json file to my containerfolder. But when I added xamarin.google.ios.tagmanager a...
Mayank Shrivastava
1

votes
0

answer
7

Views

How to disable Crashlytics while in debug mode, in react-native-firebase?

I have enabled firebase Crashlytics inside react native application. I want to disable crash logs while working on development mode. How can I disable crash logs in debug mode for both Android and Ios Application. To create crash logs I have followed react native firebase documentation check this of...
Archana
1

votes
1

answer
145

Views

VS2012 C++ to XCode

I have written a DLL in VS2012 C++ and did not use anything fancy. I think I have stayed cross-platform, at least I hope so. Can somebody tell me how to most easily get it to compile to OSX code? I think I will have to do some manual work, but I would like to find a pipeline that would allow me to...
tmighty
1

votes
1

answer
7.6k

Views

UITableView Header Styling - Font Color / Background / Font Size

Im struggling trying to style a UIView Header, I'm using IOS7 storyboard and custom cells - each of which has its own class - I would to achieve an opaque grey background with white text - Helvetica Neue Medium Font size 16 - the initial header is hidden in the HeightForHeaderInSection method - So...
Dancer
1

votes
2

answer
2.6k

Views

convert hex to NSString

i converted to hex by: NSString * hexStr = [NSString stringWithFormat:@"%@", [NSData dataWithBytes:[string cStringUsingEncoding:NSUTF8StringEncoding] length:strlen([string cStringUsingEncoding:NSUTF8StringEncoding])]]; i converted from foreign language so each character is now 4 bytes in hex. i ha...
user2755038
1

votes
1

answer
771

Views

Live Bytes of app reaches above 1 GB and simulator shows blank screen

I am working in a big project. There was no problem till last hour. Suddenly my app's live bytes keeps on increasing and it touches above 1 GB and I can't even identify where the problem is. I have searched and found this but its for overall bytes not for live bytes. I got the following error after...
Yohan
1

votes
1

answer
1.4k

Views

Custom label not displaying in custom cell. Storyboard

I've looked through all the related questions and I still can't get this working. I made a custom cell .xib (foodCell.xib) and set it's file owner to foodCell.h. I have also set the identifier to foodCell. So far all I have in the custom cell is a custom label - priceLabel . The problem I'm having...
user3085646
1

votes
1

answer
5.1k

Views

UITableViewCell custom accessory button

I use this accessory in cells in a TableView: cell.accessoryType = UITableViewCellAccessoryDetailButton; I would like this detail button to look like the clear button in text fields though. How do I do that and still be able to use accessoryButtonTappedForRowWithIndexPath:indexPath method.
ZviBar
1

votes
1

answer
35

Views

Apple Table View multiline text should be tailed like in the last line for every line

I have the Problem that in my Table View with multilines always only the last line is tailed with ... at the end. The first and the second line contain a very long string without spaces and the should also tailed at the end of the line. For example the strings look like this "Howareyouandwhatsyourna...
user1988293
1

votes
2

answer
2.2k

Views

-webkit-transform: scale breaks down when zoomed in on iOS

EDIT: These issues appear to have been fixed by iOS8. Consider this issue an iOS7 and earlier bug. I've got some content (subject to CORS) that I'm serving in an iframe, that I want to be always stretched across the bottom of the browser window. I need this content to keep the same aspect ratio and...
Mordred
1

votes
1

answer
1.7k

Views

NSNotificationCenter not working ios 7

I'm trying all kinds of examples of NSNotificationCenter, but none of them are working. I have a UITableViewController that when a user clicks a cell, it opens a UIViewController that houses a WebView. Just to get the ball rolling, I'm trying to have the UITableViewController log a message that it...
A2345sooted
1

votes
1

answer
279

Views

iPhone unexpected duplication of TCP packets on different ports

I'm running this simple asio-based program: Address address = Address::from_string(host); Tcp::endpoint ep(address, port); Tcp::resolver::iterator endpoint_iterator = resolver.resolve(ep); Tcp::socket socket(io_service); asio::connect(socket, endpoint_iterator); Everything works fine on my host mach...
1

votes
2

answer
909

Views

'Attemped to add nil node', reason: 'Attemped to add nil node to parent: <SKScene> name:'(null)'

I have these 3 lines of code: self.tapToFlyLabel = [SKSpriteNode spriteNodeWithImageNamed:@"tap_to_fly"]; self.tapToFlyLabel.position = CGPointMake(self.size.width/2, self.scene.size.height-250); [self addChild:self.tapToFlyLabel]; Everything works fine while running on 'iPhone retina 3.5', 'iPhone...
almas

View additional questions