Questions tagged [iphone]

80007 questions
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
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
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.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
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
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
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
1

votes
1

answer
547

Views

how to drop shadows under sprites in Top-down view with cocos2d

I just started learning OpenGL and cocos2d and I need an advice. I'm writing a game in which player is allowed to touch and move rectangles on the screen in a top-down view. Every time a rectangle is touched, it moves up (towards the screen) in z direction and is scaled a bit to look like it's close...
Tomek
1

votes
4

answer
637

Views

how to set background image properly in iOS

I am working on a view based app, I have set the background image as follows. .h file: UIImageView *BackgroundImage; .m file: viewdidLoad method: BackgroundImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"BG.png"]]; [[self view] addSubview:BackgroundImage]; [BackgroundImage.superview...
M Zubair Shamshad
1

votes
3

answer
2.7k

Views

UIPickerView select row doesn't work ios7

I have a UIPickerView that is being "pushed" to UINavigationController like this: [self.navigationController pushViewController:vc animated:YES]; I would like to set the selected row. I added in ViewDidAppear: for (int i = 0; i < [countryCodes count]; i++) { if ([[countryCodes objectAtIndex:i] isEqu...
Dejell
1

votes
3

answer
792

Views

Adjust UITableView height dynamically

How can I adjust the UITableView height dynamically? Let's say I have 3 rows and each row has a height of 65. When a new row is added to the UITableView i want it to adjust it's height dynamically to fit the new row. And vice versa when a row is deleted to shrink.
Legnus
1

votes
1

answer
1.1k

Views

NSMutableArray Setter and Getter Methods

I am trying to make an FoodCourt Application. I have 3 MutableArray in AppDelegate.h // This are declaration and Getter and Setter methods for array. AppDelegate.h @property(strong,nonatomic)NSMutableArray* NameArray; @property(strong,nonatomic)NSMutableArray* QtyArray; @property(strong,nonatomic)NS...
Rajan Palaniya
1

votes
1

answer
407

Views

Access CCB root node animation timeline - Cocos2D

This is driving me insane. I am trying to access the CCB root node so I can get the animation timeline using SpriteBuilder/Cocos2d. I have heroCharacter.m that is the custom class of my animation CCNode. I am importing it into bedroomScene.m. using CCNode *_heroContainer; and in my view did load //...
1

votes
2

answer
343

Views

Size of UIScrollView and Size of Images

I have created this scrollview that loads the images dynamically. However I cannot get the images to cover the screen (should adapt to iPhone/iPad) one and one. And the height of the images is also corrupt (see attached image) What am I doing wrong? Image Source to load images: for (int i=0; i < num...
Joakim M
1

votes
3

answer
594

Views

iOS - display image from `ALAssetLibrary`

I have ViewController1 and ViewController2. ViewController1 is UICollectionView and it use ASAssetLibrary to load thumbnail into UICollectionViewCell: NSMutableArray *collector = [[NSMutableArray alloc] initWithCapacity:0]; ALAssetsLibrary *al = [TemplateEditBarController defaultAssetsLibrary]; [al...
sooon
0

votes
2

answer
577

Views

Remote notification is not delivered to my app after phone reboot

According to Apple's documentation on remote notifications: Discussion Use this method to process incoming remote notifications for your app. Unlike the application:didReceiveRemoteNotification: method, which is called only when your app is running in the foreground, the system calls this method whe...
Asahi
1

votes
1

answer
703

Views

Gcm not sended to apn when iOS app was killed

Gcm send to apn when foreground and background. < etc use > "GcmServerDemo" tool "APN Tester" tool
Kim Seung Hwan
1

votes
1

answer
348

Views

Can I code an app that share a music stream on Iphone ( using the phone as a router ) [closed]

I'm an novice apple developper, actually working on Ios project for iOS 9 on xcode. I'm working as a freelance for a client, and this client needs an app to stream music. This app must be capable to share music, it means : A user has a music on his phone and turn on the "share mode", wich enable oth...
Gabson
0

votes
0

answer
8

Views

What is the best way to store .p12 file and implement SSL in Objective-C / Swift?

This is more of like best practice question. I am trying to create a demo in which I am implementing SSL Pining. In that, I have added .p12 certificate in the main bundle and then after I was using it, but the .p12 certificate is actually extractable from .ipa file. What is the best approach to use...
Wolverine
1

votes
2

answer
88

Views

iPhone app is running at iPhone 4 size with black bars after update

Previously the app supported the iPhone 5s/SE screen and iPhone 6-8 screens (not the plus sizes), this was done using launch images. So on Plus sized devices and iPhone X* devices it would display black bars above and below the app. We then released an update where among other things a launch storyb...
Jonathan.
1

votes
1

answer
463

Views

Is there a way to get the iPhone model using sysctl?

I need to get the model number, for example: for iPhone 6 the model I wanna get is N61AP not iPhone 7,2. I need this in objective-c. I've tried some ways, but all I get is the 'iPhone 7,2' :( If there is no way of gathering this, is there a way to get the CPU vendor? Thanks!
Luiza
1

votes
3

answer
3.6k

Views

Swift ios only hide UIView or also hide elements inside UIView

In one viewcontroller I have a few UIViews that constain some text labels and buttons. Depending on what data I receive from my API I either hide some of the UIViews or populate them with data. My question now is, can I just hide the UIView or must I also hide all of the elements that are nested ins...
user2636197
1

votes
1

answer
1.6k

Views

8 Capabilities Unavailable for specific app

Hi I have an app which is also live, For the next version I want to implement deep linking for this I have to enable Associated Domains. I have enabled it at bundle Identifier also created new provisioning profile downloaded and double clicked it. But still 8 capabilities missing, Associated Domains...
user1220945
8

votes
1

answer
211

Views

iOS10 filesystem - are files no longer in app container?

For debugging purposes I've often written data to files on iOS using code such as this... NSString *docsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]; NSString *filePath = [docsPath stringByAppendingPathComponent:testName]; FILE* resultsFile = fo...
wilsonmichaelpatrick
1

votes
1

answer
1.3k

Views

How to detect if a GPS coordinate fall in an area on MKMapView?

In my App i have an Array of Coordinates(CLLocationCoordinate2D) of perimeter of a circle. And now i am getting a coordinate from somewhere and i need to check if the new coordinate fall inside the circle. And if it does i just wan to show a pin on that coordinate and basically it should fall under...
Ashutosh
1

votes
1

answer
182

Views

How to change UICollectionViewCell initial layout position?

Background So, I'm working on a custom framework, and I've implemented a custom UICollectionViewFlowLayout for my UICollectionView. The implementation allows you to scroll through the card stack while also swiping cards (cells) to the left/right (Tinder + Shazam Discover combo). I'm modifying the U...
JoniVR
0

votes
0

answer
4

Views

iPhone - Detecting multiple sim cards programmatically

iPhone XS, iPhone XS Max, and iPhone XR feature Dual SIM with a nano-SIM and an eSIM and I want to detect all the carrier registered in any of these devices.
Nirav
1

votes
2

answer
1.4k

Views

App crashes in AppDelegate and cannot get past launch screen

The app crashes in AppDelegate, unable to get beyond the launch screen. No view controller code ever gets executed. The stack trace is also not very helpful nor is the line highlighted in AppDelegate when the crash occurs. Images below provide the details. How to debug from here?
Crashalot
1

votes
1

answer
238

Views

Email campaigns using Firebase Dynamic Links

Use case: send email to users that currently don’t have the app installed. The email shall contain two links for Google (Android devices) and Apple (for iPhone). When the user taps on the link, launch Google play or Apple store app on the phone pointing to the app so that the user can download. Is...
Sai
1

votes
1

answer
255

Views

How do I figure out pixel to point conversion on specific iPhone?

I'm trying to upload 256 x 256 images from my iOS app. I've resized an image to CGSize(width: 256, height: 256), but it gets uploaded as 768 x 768. This makes sense, because on my iPhone X, 1 point is 3 pixels. This isn't consistent though. On some iPhones, 1 point is 2 pixels. How do I figure out...
David
1

votes
1

answer
986

Views

Chrome and Firefox are not able to access iPhone Camera

The below code of HTML and JavaScript var video = document.getElementById("video"); navigator.mediaDevices.getUserMedia({video: true, audio: false}) .then(function(s) { stream = s; video.srcObject = s; video.play(); }) The link works fine on all Browsers in Android device, also works fine on Safar...
Simon Fernandes
1

votes
1

answer
246

Views

Playing audio in asset library

I'm trying to load/play an audio file store in the assets library but for some reason it can not be found in the bundle. Here is my code: func playAudio() { let path = Bundle.main.path(forResource: "sound", ofType:nil)! let url = URL(fileURLWithPath: path) do { sound = try AVAudioPlayer(contentsOf:...
user2924482
1

votes
1

answer
240

Views

Simulator error for iPhone 8 and X : Unable to lookup service com.apple.CoreSimulator.host_support: 0x3

I am building a Cordova App for iOS using XCore. It perfectly works on simulator of all devices from iPhone 5S to iPhone 7, and for iPhone 8 Plus. But I need my app to work for iPhone 8 and iPhone X devices. Here is my error when I run my app on iPhone 8 or iPhone X. The simulator is turning on, b...
DeenOub
1

votes
1

answer
36

Views

Custom iOS SDK's approval from Apple

I am creating my own custom SDK. Cocoa touch framework I will be creating. I want to be sure that my code is as per the apple guideline's and it is not violating any rules of it. So like any iOS app goes under approval, I want my SDK also approved by apple. Is it possible?
Fenny Roy
1

votes
2

answer
617

Views

How to reorder a NSMutable array on the basis of NSString stored into it?

I have an array of NSString, I want to move a particular NSString onto zero index of that array. I am getting values into array after sorting it. How can I implement it?
Lalit Paliwal
1

votes
4

answer
2.5k

Views

How to display large numbers of pins using Google Maps API on iPhone App over populating screen with red pins - suggestions on improved User Interface

I am developing an iphone app that involves populating a google map with lots of locaiton points around the UK. There are over 10,000 points and when the user scrolls out each point is fixed to the map based on a lat./long position, and every time the user changes their zoom amount it has to reload...
sean-seamus
1

votes
2

answer
2.1k

Views

Accessing NSManagedObject from background thread

So I know NSManagedObjects are not thread safe, and the best way to get objects from a background thread is to use [context objectWithId:id]; , and so pass around object ids instead of the actual object. Let's say I have a global NSManagedObject in my AppDelegate (not the best design pattern, but ju...
Snowman
1

votes
2

answer
6.8k

Views

Cocos2d-x - Understanding positioning sprites on screen

Can anyone provide some basic pointers on placing CCSprites on screen? Example: CCSize s = CCDirector::sharedDirector()->getWinSize(); With s, say I wanted to position a sprite on the very bottom of the screen starting at 0, think something like grass. if I am running at 1024 x 768, middle is: set...
Jason

View additional questions