FAQ Database Discussion Community


Managing user login segues in swift iOS

ios,iphone,swift,view
I am trying to build an initial user login system for an iPhone app. I have created an API which holds all the user data. I have successfully made a HTTP connection from my swift code to my API, where I sent the users login details the API authenticates the...

Website not displaying properly in iPhone 6 and iPhone 6+

html,iphone,responsive-design
I am totally new to iPhone coding. I have a website, and it's working perfect in all mobiles and desktop versions, except iPhone 6 and iPhone 6+. Problem is, it is not showing full page, i.e. width and height not coming 100% Can any one guide me what changes I...

UIAddressBook in UITableView with NSObjectClass

ios,objective-c,iphone,addressbook,abaddressbook
I need to make a UITableView which fetches address book contents in it and also a UISearchBar which searches the address book contents. I need an implementation like this project http://www.appcoda.com/search-bar-tutorial-ios7/ But the problem is here the data is static and I want to load address book's data in it....

AVPlayer seekToTime playing from beginning

ios,iphone,avplayer
I'm trying to use AVPlayer to play audio from external URL (.mp3 files stored in Amazon S3). I can make the player play and stop the audio perfectly, but when I try to resume it, it starts every time from the start. My code for play / pause and resume...

Deleting event from iCal not working when iCal is not in background

ios,objective-c,iphone
Am trying to delete the event from iCal as soon as I get the notification. The event is getting deleted only if iCal is in background. If the same notification is sent after closing iCal, the event is not deleted. Am trying to access iCal using this method in MyCalendar.m...

Setting Autolayout Constraints on UIButton in Swift

ios,iphone,swift,constraints
I'm still trying to get my head around Swift Autolayouts here in XCode 6.3. I have set up a View Controller that I stuck a couple of labels on in Interface Builder. I have added a UITextView and UIImageView programmatically, and am trying to add a UIButton at the bottom...

Xcode 7 beta 1 view doesn't fit [on hold]

ios,iphone,xcode,swift,xcode7
In all previous versions of Xcode, my storyboard for this app was fine, but since updating to the Xcode 7 beta, running on the simulator and on device (iOS 9) the view size seems to be distorted. Similar to an app that hasn't been optimised for iPhone 6/6 Plus, but...

How do I avoid hover event to fire in iPhone and iPad?

javascript,ios,iphone,javascript-events,jquery-hover
I had added an effect on hoverEnter and hoverLeave on my Divs assuming that these events wont fire on iOS devices. But on iOS devices the hoverEnter and click event fire and the hoverEnter effect is maintained. I dont want these hover events to fire on mobile devices. What should...

From where geocode server Apple API get its information

ios,iphone,swift,core-location
I'm working on backend of my iOS app. I need a list of all countries that CoreLocation might return. i.e If I was in U.S the returned county will be U.S or United State. I searched and find that CoreLocation used geocode API: Link but I didn't find from where...

I am doing demo for video streaming as same as source code from git hub but I am getting errors?

ios,objective-c,iphone
[1]: https://github.com/slavavdovichenko/MediaLibDemos3x From this link I downloaded source code and I am running it in X-Code 6.3.2 but I am getting two errors can any one check it please give me a solution. Error 1- Undefined symbols for architecture i386: "_OBJC_CLASS_$_BroadcastStreamClient", referenced from: objc-class-ref in ViewController.o Error 2- ld: symbol(s)...

CBCentralManager not calling didDiscoverPeripheral method when iPhone is locked

ios,iphone,cbcentralmanager,ios-bluetooth,cbperipheralmanager
I am working on an app that scans for a specific peripheral, ones peripheral is found it should send the small amount of data. App works in the foreground and also in background. I have also add this code in the plist UIBackgroundModes bluetooth-central When iPhone is locked and peripheral...

how to make accordion in ios with image

ios,objective-c,iphone,uitableview
I would like to ask on how to hide the image in accordion using UITableView? First I create tableview and delegate it. here is the code of my viewcontroller #import "ViewController.h" #import "ListViewCell.h" @interface ViewController (){ NSArray * tableData; NSInteger currentSelection; int one; } @end @implementation ViewController - (void)viewDidLoad {...

Delete child SKSpriteNode

objective-c,iphone,sprite-kit,skspritenode
Basically I am trying to make it so that when the user hits a fuel tank the old tank disappears and a new one is spawned in a random location. Right now it's detecting the collision but I can't get rid of the child. It will just add a new...

Swift: Fatal error: unexpectedly found nil while unwrapping an Optional value (SpriteKit)

ios,iphone,swift
I've just started learning to program iOS games with SpriteKit and I'm a novice to programming (I have only programmed in Java and Swift before this). I started out by doing a tutorial I found online. I'm at the point where I am trying to add a "Game Over" scene,...

Get image name UIImagePickerController in Swift

ios,iphone,xcode,swift,uiimageview
I use UIImagePickerController to get image from phone library (iOS). After edit mode i put image to my UIImageView. I want to save this image in Core Data to use it in another View Controllers How can i do it in Swift. If it is not possible what options do...

xcode navigationbar is not more visible after popover with button

ios,iphone,xcode,uinavigationbar,popover
I have created a popover in iphone view with a button inside to segue to another ViewController. But all Viewcontroller after popOver have the navigationbar not anymore. My project structure: NavigationController -> ViewController1 -> ViewController2(popOver) ->ViewController3 All connections are: "show",except from ViewController1 to ViewController2: "present as popover" If i connect(show)...

WKInterfaceTable detect which row selected

ios,iphone,watchkit,wkinterfacetable
I just need to check which row was selected to pass data between WKInterfaceController. Here is my code, but NSLog doesn't show anything: - (void)loadTableData { NSArray* items = [NSArray arrayWithObjects:@"cell 1 ",@"cell2 ", @"cell 3",@"cell4",nil]; // Configure the table object (self.todoItems) and get the row controllers. [self.myTable setNumberOfRows:items.count withRowType:@"DinoNameRow"];...

Container views with segmented control in swift

ios,iphone,swift,uisegmentedcontrol,uicontainerview
I have a segmented control with three segments. "Cattle", "Sheep" and "Goats". In Sheep and Goats there is another segmented control "RFID" and "Mobs" I have used three container views on a parent viewController, a cattleView, sheepGoatMob view and a sheepGoatRFID view which have UITableViewControllers CattleTableViewController, SheepGoatMobTableViewController and SheepGoatRfidTableViewController. The...

How to use tests in Xcode (iOS application)

ios,objective-c,iphone,xcode,testing
In every new project I see the file with the content (and this file belongs to different target ProjectNameTests): - (void)setUp { [super setUp]; // Put setup code here. This method is called before the invocation of each test method in the class. } - (void)tearDown { // Put teardown...

Auto Rotation iOS 8 Navigation Controller

objective-c,iphone,ios8,uinavigationcontroller,autorotate
I have certain viewControllers which are managed by a UINavigationController (push and pop). I want to restrict different viewControllers to different orientations like the first one should be only in Portrait, second in portrait, third in landscape and fourth can be portrait and landscape both. I set a ViewController on...

Height did not update when switch from portrait to Landscape?

ios,objective-c,iphone,landscape-portrait
I create a UIScrollView, added other data in it, added subview to self.view. The problem is that when i switch my phone from portrait to landscape or vice versa it do not update the height so my scrollview do not work as i need to. here is the code: UIScrollView...

boolean field UIAlertController swift

ios,iphone,swift,uialertcontroller
Is there any way I can have a 'Boolean' field in an .Alert style UIAlertController or may be convert any of the available fields that can be added to .Alert into a 'Bool' value when reading the value from the field?

how to add Hours to date in swift in this format “2015-06-11T00:00:00.000Z” as in one string while parsing in SWIFT

ios,iphone,swift,date,nsdate
How to add Hours to date in swift in this format "2015-06-11T00:00:00.000Z" as in one string while parsing in SWIFT. I was trying to add time to date in ons string for parsing in SWIFT. I have two texfields representing date and time from the date picker, but when I...

How do I add rows to UIPickerView from UIAlertController

iphone,uipickerview,uialertcontroller
I have a UIPickerView that gets its data from an array that is defined in friends = [NSArray arrayWithObjects: @"jim", @"joe", @"anne", nil]; I have a button under the picker that is supposed to add new friends to the picker. When the button is pressed a UIAlertController pops up and...

UIScrollview w/ one large view, or UITableview w/ multable views?

ios,objective-c,iphone,uitableview,uiscrollview
Im working on a project that has a detailed view of a company's information. On the lower half of the view I have some buttons that don't move, but above them I have more content, that I can not fit into the screen for a 4s. So I'm thinking I...

Push Notification Testing Workflow [iOS]

ios,iphone,xcode,parse.com,push-notification
I have hit a dilemma and don't know how to go about this problem. I have an application right now being tested by a good amount of people. Within this app, I have push notifications set up. No problem with them at all. Everything is going great. I hit a...

How can I add tag value in sender while creating an UICollectionViewCell?

ios,iphone,xcode,swift,ipad
I'm very noob with swift, so i Have a question for solve a trouble in my app. In a UIView i have just added a Collection View as a Sub View, then in each cell I added a different IMAGE inside a "Wrapper View", so my question is... How can...

NSMutableArrays store only 2 objects

ios,iphone,swift,nsmutablearray,nsuserdefaults
I have a weird problem - my mutable array stores only 2 objects - its count is 1,2,2,2 and doesn't change. My only observation is that it always replaces old values f.x. I have: value1 - 2, value2 - 4 and I add next object f.x. 66 and my array...

Fatal error when unwrapping CLLocation Location Coordinate

ios,iphone,swift,ios8,optional
I currently have a test application to teach myself Core Location. It is an app with a button which will either show your location when you press a button, or an alert when location services are off. I get a fatal error (unexpectedly found nil when unwrapping option value) When...

DES encrypted value mismatching android and ios

ios,objective-c,iphone,encryption
IOS code is #import "DESCodec.h" #import <CommonCrypto/CommonCryptor.h> @implementation DESCodec { NSString *key; } -(id) init{ self=[super init]; if(self){ [email protected]"12345678"; } return self; } -(NSString *) decode:(NSString *)encoded{ NSData *inputData = [[NSData alloc] initWithBase64EncodedString:encoded options:0]; NSData *keyData = [key dataUsingEncoding:NSUTF8StringEncoding]; size_t outLength; NSMutableData *outputData = [NSMutableData dataWithLength:(inputData.length + kCCBlockSizeDES)]; CCCryptorStatus result...

Magical Record, cannot save an object: contextDidSave == NO, error = nil

ios,objective-c,iphone,core-data,magicalrecord
I'm trying to persist new entities: - (void)updateStorageWithQuizzess:(NSArray *)quizzess completion:(void(^)(NSArray *quizzess, BOOL succes, NSError *error))completion { NSMutableArray *mutableArray = [NSMutableArray array]; [Quiz MR_truncateAll]; [[NSManagedObjectContext MR_context] MR_saveWithBlock:^(NSManagedObjectContext *localContext) { for (NSDictionary *dictionary in quizzess) { Quiz *quiz = [Quiz MR_createEntity]; [quiz fromDictionary:dictionary]; [mutableArray addObject:quiz]; } } completion:^(BOOL contextDidSave, NSError *error) {...

Pass data in modal segue in storyboard?

ios,objective-c,iphone,storyboard,modalviewcontroller
My real problem is i want to pass data from childViewController to parentViewController in storyboard by modal segue. Code parentViewController.h @property (strong, nonatomic)NSMutableArray *address; childViewController.m parentViewController *parent=(parentViewController *)self.presentingViewController; [email protected]"Hello World"; This code throw exception like Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MainTabbarViewController setAddress:]: unrecognized selector sent to instance...

How do I count a number of images in a folder reference in swift

ios,iphone,swift,nsfilemanager
I'm working on an custom emoji keyboard in Swift and I'm having trouble finding and counting the images in a folder reference called "emojis". EDIT: To clarify my issue is that let contents always end up as nil. The structure from the location of the .xcodeproj file looks like this:...

Using UIPicker to create desired number of rows in UITableViewController

ios,iphone,uitableview,uipickerview
I have a view with my UIPicker that will push to my UITableViewController when my start button is pressed. I want to create a certain number of rows per section in my UITableViewController from my UIPicker. Here is the relevant code. I'm not getting errors. My UITableViewController just doesn't have...

Check UITextfield have only Alphabet not numeric value

ios,iphone,ios7
I am creating one form I want to check in Name Field if any one enter Number then show alert. Here is the code: NSString *str = abc.text; NSCharacterSet *alphaSet = [NSCharacterSet alphanumericCharacterSet]; BOOL valid = [[str stringByTrimmingCharactersInSet:alphaSet] isEqualToString:@""]; if (!(valid)) { NSLog(@"number present"); } else { NSLog(@"number not present");...

Coco2dx - Changing To Background Image

ios,iphone,xcode,xcode6,ios-simulator
I need someone's help. Actually I have no idea what to replace to get a custom background image. I'm just can't do it anymore. -(id) init { // always call "super" init // Apple recommends to re-assign "self" with the "super's" return value if( (self=[super initWithColor:ccc4(219,31,94, 999)]) ) { ws=[[CCDirector...

View Controller too thin for IOS simulator

ios,iphone,xcode,swift
As shown on the pictures, my iOS simulator shows my view controller to be too small for the screen. I can't figure out if there is something wrong with the properties of my view controller, iOS simulator or both ... Thank you for your help :) ...

iOS Swift: Sound not playing on iPhone Simulator

ios,iphone,swift,audio,ios-simulator
In my iOS Swift application, and i am trying to play sound on click of a button. func playSound() { var audioPlayer = AVAudioPlayer() let soundURL = NSBundle.mainBundle().URLForResource("doorbell", withExtension: "mp3") audioPlayer = AVAudioPlayer(contentsOfURL: soundURL, error: nil) audioPlayer.play() } I am running the application in iOS iPhone Simulator. I have doorbell.mp3...

make autoplay work on IPAD and IPHONE

ios,iphone,ipad,video
I have fullscreen video background, here is my code: <div id="video-container"> <video id="video" autoplay loop> <source src="ocean.mp4" type="video/mp4"> <source src="ocean.ogv" type="video/ogg"> <source src="ocean.webm" type="video/webm"> </video> </div> how you see it has autoplay attrubute, but on IPAD, IPHONE,etc.. it doesn't work untill you click on play button, but when I add...

Query to retrieve a BOOL from Parse DB for the current logged in user, which will determine what segue to go to

ios,objective-c,iphone,xcode,parse.com
I'm trying to create a Query that will access a BOOL from the current logged in user's data from my Parse database. So far, when the user creates an account, the boolean profileCompleted is automatically assigned to NO as the user has not finished creating their profile. (This takes place...

How can I display an UIAlertView as full screen in iOS?

ios,objective-c,iphone,uialertview
How can I display an UIAlertView as full screen in iOS ? Am very problem some times pop up tableview. So using alertview displaying tableview is easy but it is not expandng size. For that how can dispaly alertview in full screen in iOs ?

change Auto Layout dynamically

ios,iphone,xcode,storyboard,autolayout
I have to show 3 Labels like LABEL1 | LABEL2 | Label3 //Horizontally I want these 3labels width are equally divided according to Screen size width How can I achieve this with nib file directly? Thanks Question 2 Label1 | Label2 | Lable3 //All Labels widths are equally //All Labels...

How to crop video from top?

ios,iphone,avfoundation
I am trying to create square video and for that I am using 640*480 camera view but not able to crop video from top? I have tried many thing but no success. so please suggest how to do it, What transform is helpful?

Objective c - ios : How to pick video from Camera Roll?

ios,objective-c,iphone,xcode,uiimagepickercontroller
I try this : UIImagePickerController *videoPicker = [[UIImagePickerController alloc] init]; videoPicker.delegate = self; videoPicker.modalPresentationStyle = UIModalPresentationCurrentContext; videoPicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; videoPicker.mediaTypes = @[(NSString*)kUTTypeMovie, (NSString*)kUTTypeAVIMovie, (NSString*)kUTTypeVideo, (NSString*)kUTTypeMPEG4]; videoPicker.videoQuality = UIImagePickerControllerQualityTypeHigh; [self presentViewController:videoPicker animated:YES...

sproutvideo play button doesn't work on apple devices

javascript,jquery,ios,iphone,ipad
Hello I use sproutvideo to store videos, I tried to set up a control bar using jQuery UI, but the play button does not work on Apple devices like iphone and ipad, can any one help me please. This is is the working link http://sproutvideo-examples.s3.amazonaws.com/custom_player/final/index.html And this is the code...

UIView.hidden doesn't work immediatly

ios,objective-c,iphone,uitableview,uiview
I have a UIViewController with a UITableView and UIView (see blow). When I call hiddenLoadingView at somewhere, the UIView is still showing, then dismiss after 10-20 seconds, why? - (void)viewDidLoad { .... self.tableView = [[[UITableView alloc] init] autorelease]; [self.view addSubview:self.tableView]; self.loadingView = [[[UIView alloc] init] autorelease]; [self.view addSubview:self.loadingView]; } -...

UILabel text isn't updated when modal re-appears

ios,iphone,swift,ios8
I've created a reusable modal UIView as a singleton object, but am having trouble changing the text of a label it contains. When the modal appears a second time, the new text appears over the old text. I'm guessing this is due to the fact that the label is only...

How to know a file is writing via NSFileManager

ios,objective-c,iphone,nsfilemanager
I got a problem , How to know the file is accessible ??? For example , the file is writing , but not finish yet. And I check the file again , I use [[NSFileManager defaultManager] fileExistsAtPath:filePath]; It return true ... but the file is not accessible . How to...

trying to do a rate us UIAlertController

ios,iphone,swift,uialertcontroller
Whenever I run my app the following error is called Warning: Attempt to present "The alert" on "MenuViewController" whose view is not in the window hierarchy! what exactly does this mean and how do I fix it? I only have one UIViewController and here it is class MenuViewController: UIViewController {...

AFNetworking file upload

ios,iphone,xcode
I'm trying to upload file with AFNetworking and it is working with iOS Simulator but not working Real devices, i tried 2 different way but same. Can some one help me to solve this issue please Thank you very much. this is first code NSArray *paths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask,...

UIWebView path depends on previous pressed button Xcode

ios,objective-c,iphone,xcode,uiviewcontroller
I have a ViewController (A), containing n buttons. all buttons map to other ViewController(B) containing a WebView to show a different PDF. Instead of creating n ViewController, I would know how to change path according to which button was pressed. my wrong tries: 1- use tags of buttons in ClassB...

Iphone App that can open other apps? How

ios,iphone
There is an App out there that can 'intercept' pictures from snapchat. I'm not sure what low level witch craft they are using to accomplish this, but I want to learn more about how to do it and I don't know what to search! Can someone please help me? This...

UIButton with single press and long press events swift

ios,iphone,swift,uibutton
I want to trigger two action on button click and button long click. I have add a UIbutton in my interface builder. How can i trigger two action using IBAction can somebody tell me how to archive this ? this is the code i have used for a button click...

How to make the customized UITableViewCell xib width to fit the device width

ios,iphone,uitableview
I am creating a UITableTableViewCell from a nib file. I am using width of 320 for the the cell width. I found when I run the app in iphone 6 simulator, the cell cannot occupy the whole width of the table view. If I use iphone 5s, the width is...

How can I show ONLY the date (and not the time) using NSDateFormatter?

ios,iphone,swift
I think the question is pretty straightforward. I need only the date to appear, and not the time. Couldn't find anything for Swift, so my code is here: cell.date.text = NSDateFormatter.localizedStringFromDate(dates[indexPath.row], dateStyle: .ShortStyle, timeStyle: .ShortStyle) ...

Orientation of screen?

ios,iphone,swift,sprite-kit
How do I make sure that the only orientations allowed are Portrait or Upside down portrait? I made the change in the project settings, but I'm having trouble making the change in my GameViewController. I need to make the change in this function: override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask { if...

How can i use MapKit View in Xcode 6.3?

ios,objective-c,iphone
I am unable to use MapKit in Xcode 6.3. It is showing an error when I am create property for that. The Error is- Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named MKMapView'

Change database of Live App without Data Lose

ios,iphone,sqlite,core-data
I want to update the database of my existing app(for new version) which is live on the app store. So I need to delete my existing database before using app or I can change the name of the database. After it If data exists in my old database I have...

Test-Flight App beta testing time limitations

ios,iphone,ipad,ios8,testflight
I need to submit my binary files over the air without pushing app to app-store. one solution is using enterprise program, Test-Flight App Beta Testing we can send binary files to external users to limit of 1000. My Questions is : will apple take beta review (following apple guidelines) of...

UINavigationBar not showing, tried multiple fixes

ios,iphone,xcode,uinavigationcontroller
This is really frustrating because no matter anything I do my Navigation Title will not appear at all. The view is even the root controller for the navigation I have tried the following: Checking the box "Shows Navigation Bar" in Interface Builder. Using the Simulated Metrics for a Navigation bar....

how i can solve Image auto resize in iphone 4 5 6 6+

ios,objective-c,iphone,objective
I give three types of image like image.png [email protected] [email protected] but not working image autoresize in all device....

Customisable iOS Interface

ios,iphone,xcode,user-interface,customization
I am currently developing an iOS app that can be used by different clients keeping pretty much the same interface for all of them. I would like to make this interface somehow “customisable” without having to change the storyboard for every client but I am not sure how to do...

How can I get my iPhone to listen for sound frequencies above a certain threshold?

ios,objective-c,iphone,audio
I'm interested in getting my iOS app to turn on the microphone and only listen for frequencies above 17000 hz. If it hears something in that range, I'd like the app to call a method. I was able to find a repository that detects frequency: https://github.com/krafter/DetectingAudioFrequency And here is a...

How to justify label text?

ios,objective-c,iphone
My code to justify label text is given below:- -(void)justifyToLabel:(UILabel*)label withStr:(NSString*)str{ NSMutableParagraphStyle *paragraphStyles = [[NSMutableParagraphStyle alloc] init]; paragraphStyles.alignment = NSTextAlignmentJustified; NSDictionary *attributes = @{NSParagraphStyleAttributeName: paragraphStyles}; NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString: str attributes: attributes]; label.attributedText = attributedString; } I don't know that why its not working. Please give a best...

I have 2 issues preventing the conversion to ARC tool from running on xCode 6.3.1

ios,iphone,xcode,automatic-ref-counting
Issue 1... There is a whole lot of these releases that were automatically created when I initially wrote this code several years ago. I am assuming that all the others will go away after running the ARC migration tool. Why is this one being singled out, and how do I...

UITableView with UITableViewCell containing UIImageView

ios,iphone,swift,uitableview,uiimageview
Okay, so I am only able to scroll outside the borders of the UIImageViews, but I need to be able to scroll on top of those views. The UIImageView contains Pan Gestures, Pinch Gestures, and I am unsure if that is causing the error. I will paste my cell code...

Dealing with graphical assets for iPhone 5/5S/6/6 Plus

ios,iphone,xcode6,iphone-6,iphone-6-plus
Since the induction of 6 and 6 plus its the first time I'm starting to work on a new app. Now I'm a bit confused about the use of graphical assets for my app. See for 5/5S things were pretty simple. If I have to make an image view of...

How to increase video quality/Resolution in OpenTok RTC(Real Time Communication)

ios,objective-c,iphone,opentok,tokbox
I am using OpenTok iOS SDK (Multi Party Call Demo). How can I increase video quality? I am having high speed internet connection during video call but video quality is not so good as it should be. Any help will be appreciable....

Using a Nib file for a UIView — Issue with layout

ios,iphone,swift
I am using Swift to create an application for administering quizzes, and for the "quiz" view, which contains all of the questions on separate "cards", I am having issues with the layout of the question card. I am using a .xib file to create the outline for the card, and...

Ambiguous use of “value” while implementing UIStepper

iphone,swift,xcode6.3
I am trying to implement a simple stepper which reflects its value onto a label. While using "Int(sender.value)" I am getting an error "Ambiguous use of value" // ViewController.swift // Stepper // // Created by Prabhu Konchada on 19/06/15. // Copyright (c) 2015 Prabhu. All rights reserved. // import UIKit...

Bullet points are not recognized in HTML String

ios,objective-c,iphone
I have a string: NSString *str1 = @"\u2022 You were held in custody for a longer period of time than may have been necessary."; I am converting it into an HTML string using this code : - (NSString *)HTMLString { NSDictionary * const exportParams = @{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType}; NSAttributedString *attributed =...

Which Image will be used on iPhone 6 device

ios,objective-c,iphone,uiimageview
I have added @1x, @2x, & @3x images in asset catalog. @2x will be used in iPhone 4/4s, iPhone 5. @3x will be used in iPhone 6 Plus. So in iPhone 6 which image will be used? ...

How to change element title inside UITableViewCell?

ios,objective-c,iphone,swift,uitableview
I have a button on custom tableviewcell. I've been able add action to this button by add target like below code: var playButton = cell.contentView.viewWithTag(5) as? UIButton var sender : UIButton = UIButton() playButton?.addTarget(self, action: "playPost:", forControlEvents: UIControlEvents.TouchUpInside) playButton?.layer.setValue(object["previewUrl"] as? String, forKey: "songUrl") playButton?.layer.setValue(indexPath.row, forKey: "index") But, how can I...

Update Text Field While Automating iPhone App

iphone,xpath,textbox
I am automating an iPhone App. The scenario is Login Logout and re-Login. But while re-login the username and password field is displaying the details. I am trying to list that xpath as a WebElement and clear() that field if(Webelement.gettext() !="") But it is not happening as in the existing...

coordinate deprecated as of iOS 7

ios,iphone,swift
I am trying to grab the latitude and longitude of a users location. I have a code which worked prior to deprecation, and I cannot figure out how to fix it. The error is on the coordinate section of latestLocation.coordinate.latitude and latestLocation.coordinate.longitude, and the error states: 'coordinate' is unavailable: APIs...

How to Screenshare of my iPad on Mac

iphone,ipad,airplay,screensharing
I have a big demo of my iPad application to my client,i tried AirServer, Bomgar but those are not working to share my iPad Screen on the Mac. Can any one help me which tool i should use for screenshare of my iPad to Mac. If i can share my...

How to transfer files from iPhone to EC2 instance or EBS?

ios,iphone,amazon-ec2,amazon-s3,amazon-ebs
I am trying to create an iOS app, which will transfer the files from an iPhone to a server, process them there, and return the result to the app instantly. I have noticed that AWS offers an SDK to transfer files from iOS app to S3, but not to EC2...

No valid iPhone code signing keys found in keychain in xamarin

ios,iphone,xamarin
I have a Xamarin project in which I am getting Error: No valid iPhone code signing keys found in keychain.. As suggested in this question, I have set Configurations Mappings from iPhone to iPhoneSimulator. And its done as evident in the Build Output. Here is the screenshot: (Dont have enough...

this class is not key value coding-compliant for the key itemname

ios,objective-c,iphone,core-data,ios7
What I am trying to do is take the text that is in my uitextfield called editItemField and write the value in the NSString called toDoItemName to my core data model with the attribute named itemname. Im getting the above error. My core data model has one attribute named itemname...

set the constraint of UICollectionView and UICollectionViewCell but does not display correctly

ios,iphone
set the constraint of UICollectionView and UICollectionViewCell but does not display correctly UICollectionView UICollectionViewCell Display UICollectionViewCell does fit the screen width Yourc ommetnwelcome...

iOS gradient effect over UILabel

ios,objective-c,iphone,uilabel
I want to add gradient effect on a UILabel so it look like: Please note the gradient effect on left and right corner.I've no clue how to do that.any help or suggestion would be appreciated. Edit: - I tried with this code- UIColor *endColor = [UIColor colorWithRed:20/255.0 green:157/255.0 blue:189/255.0 alpha:1.0];...

getting error GestureRecognizer with UIImageview in swift

ios,iphone,swift,uiimageview,uigesturerecognizer
i am using 20 uiimageview so i have given tag value of each imageview now i want to add GestureRecognizer on each image view for index in 0 ... fields.count - 1{ let gestureRecognizer = UITapGestureRecognizer(target: self, action: "fieldsTappedAction") gestureRecognizer.numberOfTapsRequired = 1 println(fields[index]) fields[index].addGestureRecognizer(gestureRecognizer) } now i am trying to...

Pass data from one view controller to the next WITHOUT a segue in swift

iphone,swift,uiviewcontroller,ios8,segue
So I have an app that where you choose a button in the first screen it will bring you to another screen depending on which one you chose on the first one. Because I have these possible different layouts I can't just use a segue from one button to the...

Html5 input type number formatting

android,iphone,html5,windows-phone-8,input
I have this page where i use the input type number. so that it will show the numeric keyboard on wp, android and ios device . But my problem is that if the user use a culture info on the device for. lets say Denmark. the numeric keyboard shown use...

Xcode is not showing my buttons, labels, textfields, and views

ios,iphone,xcode,swift
Xcode is not showing all the buttons, textfields, etc. I have in my storyboard. As you can see in the image below, somehow all my elements are appearing with a "watermark" in the storyboard element inspector on the left. Why is it doing this? How can I fix it? It...

create a popup window with just a textview/string and a button SWIFT ios 8

iphone,swift,ios8,popup,xcode6
I am very new to ios 8 and swift but I have not found a way to make a simple popup window whenever a button is pushed. I payed for tutorials and they still don't cover it. All i would like is for when the user pushes a button (the...

Locking orientation issue in iphone

ios,objective-c,iphone,ipad,uiinterfaceorientation
I have a structure like this LoginViewController-->Root LoginViewController-->UINav---->HomeViewController Now I have to lock this orientation to portrait only for iphone and have to provide both orientation for ipad For the Login Controller I wrote this -(BOOL)shouldAutorotate{ if(UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPad) { return YES; } else { return NO; } } This is working...

Restrict app for iPhone devices lower than iPhone 5 with iOS 8 or 7 in AppStore

iphone,ios8,app-store
I planned to develop application with targeted devices iPhone 5/5S, iPhone 6/6+ . I don't want my application to be runnable on iPhone 4S. Can i able to achieve that? I googled some sites , they were mentioned that we can restrict older version mobiles like iPhone 3GS using front...

Is it possible to obtain an unique iCloud user ID on cocoa?

ios,iphone,cocoa,ipad,icloud
My iOS app is currently on beta in TestFlight, and as a way to retribute to the nice people who helped me test it I would like to offer them some goodies such as, for instance, the full final version of the app for free. For this, I was thinking...

Underline in attributed text not working in iPhone 6+

ios,iphone,nsattributedstring
I want to create a method that returns me attributed text. here is the code that i am using - (NSAttributedString *)getUnderlineAttributedStringForText:(NSString *)strWholeString andTextToHaveLink:(NSString *)strLink TextColor:(UIColor *)textColor LinkColor:(UIColor *)linkColor withFont:(UIFont*)font { NSRange stringRange = NSMakeRange(0, strWholeString.length); NSRange linkRange = [strWholeString rangeOfString:strLink]; NSLog(@"String Link :: %@",[strWholeString substringWithRange:linkRange]); NSMutableAttributedString *attributedString =...

How to change an app's name displayed in app store before submitting for review?

ios,iphone,itunesconnect,rename
My app's status is "prepare for submission" (way before going live), so there must be a simple way to change its name, but I really can't figure it out on my own; help's needed! I need to change the name displayed in app store, not in xcode!

creating a wrong NSDate

ios,objective-c,iphone,cocoa,nsdate
This is the code NSDateComponents *comps = [[NSDateComponents alloc] init]; [comps setDay:13]; [comps setMonth:6]; [comps setYear:2015]; NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDate *date = [gregorian dateFromComponents:comps]; NSLog(@"date = %@", date); the result is 2015-06-12 23:00:00 +0000 12? the day is 13!!! Why is that happening? Bug? ...

Can't move object in Sprite Kit

iphone,swift,sprite-kit
I am trying to make a bubble shooter kind of game but I cannot move my paddle. Any idea why this happens? // // GameScene.swift // gggame // // Created by divy on 6/17/15. // Copyright (c) 2015 divy. All rights reserved. // import SpriteKit class GameScene: SKScene , SKPhysicsContactDelegate...

change storyboard tab bar icon using swift

ios,iphone,swift
I've created a tab bar controller and embedded several view controllers in it. I then try to set a specific tab bar item in a corresponding swift file for that view. Problem is that I am changing the item by overriding the "viewDidLoad" function. So it only updates after the...

Why use CGImageRef not CGImage instead?

ios,objective-c,iphone,cgimageref
I'm a new one to the media layer and the photo layer ,and what makes me confused is that there a lot of objects like CGImageRef and CMSampleBufferRef ,and I don't know why apple let us use objects like "XXXRef" not objects like "XXX"? I know there must be some...

Facebook logout iOS SDK

ios,objective-c,iphone,facebook
In the latest SDK of Facebook for iOS 8, the login button itself changes to logout once the user logs in successfully. I have a separate logout button in my applications. When the user is successfully logged in using my own server credentials, google+ or facebook, the app takes the...

GCM support for ios application when application in background or killed

ios,iphone,xcode,android-gcm
Hello all i am integrating GCM in iOS application using following link https://developers.google.com/cloud-messaging/ios/start. I have also uploaded the certificates when configuring the file on defined steps. I have also succeeded for getting notification,but the problem is that i am not getting the notification when the application is killed or in...

How to prevent duplicate entry on parse?

ios,objective-c,iphone,swift,parse.com
I' trying to save song info to parse, but if the song already exist in parse I want my code just do nothing. I've tried this code below: var Music = PFObject(className:"Musics") var query = PFQuery(className:"Musics") query.findObjectsInBackgroundWithBlock { (objects: [AnyObject]?, error: NSError?) -> Void in if error == nil {...

Xcode 6 with iOS 9?

ios,iphone,xcode,ios9
I'm fairly new to iOS development and I upgraded my device to iOS 9.0 beta, to see how my app faired. However, I did not upgrade to Xcode 7 beta. I'm getting an error that says my device is now "ineligible", specifically, iPhone (3) may be running a version of...

iPhone - get amplitude of audio at current point

ios,objective-c,iphone,avaudioplayer
First off: I don't know much about audio processing. I know with Core Audio, you can get the info about a playing track. My goal is to have a node in SpriteKit with the current amplitude/loudness of the current song from iTunes being its scale (say, scale should be at...