spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
  Home » IOS » Page 3
iOS countdown to show hidden button
use timer like -(void) viewDidLoad { [self.btnDone setHidden:true]; [btnDone addTarget:self action:@selector(done) forControlEvents:UIControlEventTouchUpInside]; self.timer = [NSTimer scheduledTimerWithTimeInterval:3.0 target:self selector:@selector(timerFinished) userInfo:nil repeats:NO]; } -(void)timerFinished { [self.btnDone setHidden:fales]; } your method. - (v

Categories : IOS

Swift: 'Tap to Begin' button - delete itself
The easiest way is to just hide it. Create an outlet connection so you can reference the button as an class instance property, then set its hidden property to true from the tap handler: @IBOutlet private weak var btnBegin: UIButton! @IBAction func didTapBegin() { ... btnBegin.hidden = true }

Categories : IOS

Access View Controller method from App Delegate in Swift - asking for parameter
If your update doesn't reference self, then make it a class method and that will fix your problem. If the method does reference self, then you need an instance of the class to call the method.

Categories : IOS

How can i get resolution of any ios device using AIR..?
This solved my problem. Go into the App Descriptor XML file. Toward the bottom (generally one of the last items in the file), there should be this line. standard If it is commented out or set to "standard", this would be your issue. Change it to say "high" and that will enable Retina support. "standard" scales the non-retina display (320x480 on iPhone, 1024x768 on iPad) up. "high" will give you t

Categories : IOS

Applying autoLayout constraints to multiple objects
You can make height of yellow strip flexible by setting 2 constraints. Set both top space and bottom space to container (cell's content view) to 0. Ensure there is no constant height constraint for it.

Categories : IOS

Upload Image issue in Xcode and ios
use this for sending image file. write down this code, once you have posted your text data on server. UIImage *img=self.imgView.image; NSData *imageData = UIImagePNGRepresentation(img); NSString *urlString = [NSString stringWithFormat:@"%@upload.php",@"http://localhost:8888/ImageUploadiOS/"]; NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; [request setURL:[NSURL URLWithString

Categories : IOS

custom class method returning nil Swift IOS
My understanding is that you have an api variable, which should contain an instance of API, but it's nil instead. Are you initializing it? The fact you are using optional chaining indicates that the variable is an optional, and if it's nil this statement: api?.SaveEditModel(user!) does nothing. So, double check if you are assigning an instance of API to the api variable in your code.

Categories : IOS

Get User location alert does not stay on screen in iOS 8
You code looks really weird, since you seem to be calling the requestAlwaysAuthorization twice. Once on self.locationManager and once via the sendAction. You code should look like: self.locationManager = [[CLLocationManager alloc] init]; [self.locationManager setDelegate:self]; if ([self.locationManager respondsToSelector:@selector(requestAlwaysAuthorization)]) { // iOS8+

Categories : IOS

Cocoapods: Pod is in the master repo but is not available for install
I've fixed it. I solved it by removing my ~/.cocoapods/repos/master and letting Cocoapods re-initalize the repo. What was confusing was that the same error message was occurring on a different machine. It may have just been coincidence, but I guess it could also have been a bug in Cocoapods.

Categories : IOS

How to add a character at a particular index in string in Swift
You can't, because in Swift string indices (String.Index) is defined in terms of Unicode grapheme clusters, so that it handles all the Unicode stuff nicely. So you cannot construct a String.Index from an index directly. You can use advance(stringts.startIndex, 3) to looks at the clusters making up the string and compute the index corresponding to the third cluster, but caution, this is an O(N) ope

Categories : IOS

How to add pod 0.3.3
Seems that you don't have the cocoapods installed. You need it to run the Pod Install command. Open your terminal, run: gem install cocoapods Then, go to your project directory in terminal, you can use the "cd" command to do it. When you are in your project's folder, run pod install.

Categories : IOS

Creating a UITableViewCell programmatically in Swift
In general: Everything is possible in pure programming ;-) Create a custom class for your tableView cell and there setup all the elements, properties and the visual layout. Implement the required methods init(style,reuseidentifier) In your custom class for the UITableViewController register the custom cell class using registerClass(forCellReuseIdentifier) Setup your delegate and datasource for t

Categories : IOS

Can you open LinkedIn iOS 8 share extension?
The iOS 8 extensions cannot be presented in a custom share screen. You absolutely have to use UIActivity​View​Controller in order for the share/action extensions to appear. For the linkedin extension to appear in your app, you have to: Use UIActivitViewController to present the share sheet and the users have to: Open the share sheet Select More Enable (flip the switch to green) for the

Categories : IOS

iOS - UIAlertView/ UIAlertController orientation issue in iOS 8
Please see the link as I have answered this Question.

Categories : IOS

Maintain offset when reloadRowsAtIndexPaths
I know this is an old question, but I had this same issue and couldn't find the answer anywhere. After reloadRowsAtIndexPaths:withRowAnimation:, the tableView determines its offset using the estimated heights given in tableView:estimatedHeightForRowAtIndexPath:. So unless the value you return there is accurate, implementing it will cause your tableView's offset to change after the reload. I unimp

Categories : IOS

How to set tag to UIImageview Image is equal to Array Index for each Image in iOS?
You need to add button to scrollview and set tag to it.. for(int index=0; index < [self.imagesa count]; index++) { NSDictionary *dict=[self.imagesa objectAtIndex:index]; NSString *image=[dict valueForKey:@"link"]; smallImage = [[UIImageView alloc] init]; imageButton =[UIButton buttonWithType:UIButtonTypeCustom]; pageLabel=[[UILabel alloc]init]; smallImage.tag=index;

Categories : IOS

how to parse string array with SwiftyJSON?
You have a Dictionary which holds an Array which holds Strings. When you access a value in the Dictionary, it returns a simple Array of Strings. You iterate it like you would any array. for obj in json["array"] { println(obj.stringValue) }

Categories : IOS

Defining UIAlert in a separate class file, then invoking it from any view controller
you need to invole it with 'self' instead of GameScreenViewController as second argument from within your view controller you like to display the error. what you are passing currently is not an object but merely a classname. class GameScreenViewController : UIViewConroller { // your viewcontroller logic func showError(){ // try this: Errors().errors("Error text", curre

Categories : IOS

Parse JSON in SWIFT
NSURL is a failable initializer and exactly this happens when you give an invalid url: It fails to initialize. So wrap your code in an conditional unwrap: if let url0 = NSURL(string: newUrlPath!) { ... }

Categories : IOS

Writing data to iBeacon
If the hardware was programmed by you, then you should know how it accepts written values. Does is use GATT characteristics to do so? If so, look at CoreBluetooth APIs in iOS to do this. Properties of CLBeacon are read only, so you cannot use them.

Categories : IOS

“Show Obj-C only” setting is missing in Instruments 6.1
I've also noticed this and while it's not exactly the same, I use the following toggle in the new interface builder to focus on my personal code: Toggle Off: Toggle On:

Categories : IOS

LLVM 6 : Prefix Header vs Preprocessor Macros Not Used in Precompiled Headers
You can define macros here that are available to the pre-processor at compile time Add something like DEBUG=1 in the settings for the debug compile, then you can use this in your code for example to have a conditional compile: #ifdef DEBUG ... #endif EDIT: The first is a link to a PCH file. You can do all sorts of definitions there. This will be compiled into the app and executed at runtime. T

Categories : IOS

How to disable scroll in a specific subview of a UIScrollView
Use -touchesBegan of UIResponder class. If the touch is from your subview(which you don't want to scroll). Disable scrolling of the scrollview. if -touchesEnded or -touchesCancelled is called for that view. enable scrolling of your scrollview.

Categories : IOS

Offline web app is not working on iphone
I've fought with same issue some time ago. I got it working with this kind of combination: CACHE MANIFEST # Cache manifest version 0.1 CACHE: /scripts/home.js /scripts/read.js FALLBACK: . . NETWORK: *

Categories : IOS

ios ipad tabbar in splitview layout like this image
You should learn SplitViewControllers. Here is the link - https://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/ViewControllerCatalog/Chapters/SplitViewControllers.html

Categories : IOS

Allow unverified ssl certificates in WKWebView
URL object: NSURL *url = [NSURL URLWithString:urlAddress]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:requestObj delegate:self]; [connection start]; And then, add this to your delegate: - (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectio

Categories : IOS

IONIC Framework platform add IOS
you havent mentioned the command you tried. but here the process. Install NODE.JS first Install Cordova and Ionic sudo npm install -g cordova ionic Create Ionic project ionic start MyProject sidemenu add Platform ionic platform add ios

Categories : IOS

iPhone layouts without using auto Layout
You could use multiple XIBs/Storyboards for the layouts on different devices and check if the device is an iPhone 5 or iPhone 6 when you load the XIB/Storyboard. This would be really cumbersome task, laying out same UI for two different devices, you may want to consider using Auto Layout at some point of time

Categories : IOS

Pass string as tag or other value in button
You cannot set NSString variable to integer property, it is not possible in Objective-C (if it was an object, technically you could, but you are dealing with a primitive here). You could use associated properties in Objective-C runtime. You can set any additional variable to any object using this API and then also retrieve it at a later point. See the link below for more information. http://oleb

Categories : IOS

i Have the local path of image in xcode and i want it to covert the image into base64 and send it to the php file
Download NSData+Base64 category, and add it to your project. After that in your Controller for example. #import "NSData+Base64.h" ..... NSString *base64 = [[NSData dataWithContentsOfFile:path] base64EncodedString]; // Request and send your base64 string to server, as usual you're sending another string Or if your deployment target is iOS7+, use this NSString *base64 = [[NSData dataWithConten

Categories : IOS

Flip the video recorded with front facing camera along horizontal axis in IOS
You made a small mistake with affine transformations. Replace the code: CGAffineTransform t = CGAffineTransformMakeTranslation(videoAssetTrack.naturalSize.height, 0.0); t = CGAffineTransformMakeRotation(degreesToRadians(90.0)); t = CGAffineTransformMakeScale(-1, 1); //this line is where I am having problem With corrected code: CGAffineTransform t = CGAffineTransformMakeScale(-1.0f, 1.0f); t

Categories : IOS

Pass a URL as paramater for AFNetworking
Just check using hasPrefix in NSString NSString *strURL = @"http://www.google.com"; //Check if string contains http if([strURL hasPrefix:@"http"]) { //Check if format is correct if not then make it correct if(![strURL hasPrefix:@"http://"]) { strURL = [strURL stringByReplacingOccurrencesOfString:@"http:/" withString:@"http://"]; } } else //doesnot contain http { //Ad

Categories : IOS

AngularJS Web App stopped working on iPhone 6
I debugged this on the actual iPhone 6 that was having the problem and I saw that it was failing when the token returned by the server was being stored in session storage. I called up Apple support and spent a fair bit of time on the phone with them. The page was working on other iPhone 6 devices but not this one. After trying a few different settings and confirming it was working on Chrome, the

Categories : IOS

Form Sheet of Modal Segue doesn't work with storyBoard
You can make use of Modal Segue in the storyboard and make sure that you embed the view controller in the navigation controller. And perform segue whenever you need to: [self performSegueWithIdentifier:segueIdentifier sender:self]; Also make sure of the content size of the form sheet and place the sub views in correct position.

Categories : IOS

How does iOS app Fing get MAC Address?
Fing can only get the device's MAC address if the device is connected to a WiFi network. I suspect it implements an ARP scan on the local network and matches the known local IP address to determine the local MAC address. There are some questions that address capturing ARP data here and here

Categories : IOS

TabBar in iPhone 6 and 6 plus
It seems to me as a wrong approach to assign image to tabbar item. Please refer this code; You have to specify the images for every tab item. The following code is working for me if ([[tabBarController.tabBar.items objectAtIndex:0] respondsToSelector:@selector(setFinishedSelectedImage:withFinishedUnselectedImage:)]) { [[tabBarController.tabBar.items objectAtIndex:0] setFinishedSelecte

Categories : IOS

navigationItem setRightBarButtonItems spacing too wide
I have did this before. You have to create your own UIView for the button. cause the default uibarbuttonitem with have some padding one left and right side. ViewIconBtn* searchViewIconBtn = [[ViewIconBtn alloc] initWithImage:[UIImage imageNamed:@"searchIcon.png"]]; [searchViewIconBtn.btn addTarget:self action:@selector(toSearch) forControlEvents:UIControlEventTouchUpInside]; UIBarButtonItem* btn

Categories : IOS

Implementing server side In-App purchase
I had worked on an app like yours , i will recommend you to make categories of of Videos and apply Non-Consumable in-App Purchases on particular Category , if User Buys a category , all videos of that category will be unlocked.And i spent a lot of time in implementing IAP , but one tutorial helped me out successfully.Follow it , it also has code to how to restore already completed transactions.He

Categories : IOS

Core Data with Swift - Parent/child relationship
Have you setup a relationship between the Workout and Lift entities in XCode. If each Workout will have only one Lift then use One-to-One, otherwise if each Workout has many Lifts then use One-to-Many. Once the link is established you just tell the new Lift Entity (at the point when you create it) which Workout it should be connected to. See this thread for more information: Saving CoreData to-m

Categories : IOS


Recently Add
keychain iOS touchId prompted twice
-[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x7fc748e37ea0'
Search Results Visibly Scrolling Underneath the Status Bar
How do I exclude an IOS 8 app extension from a build?
EXC_BAD_ACCESS when capturing a GPU frame
iOS 8 - Map keeps reanimating back to user location
Constantly refreshing background image of UIImageView IOS
UINavigationController keeps displaying popped view
Swift closure syntax using Shark Food Mute Switch?
MagicalRecord 3.0 not saving. No objects for the second build
iOS / Swift Can't add gesture to child class
iOS: Is there currently a way to prevent two view controllers being pushed or popped at the same time?
Checking if array contains two objects
How should turning of SCNLight affect background color?
Why don't my views show up in Storyboards and are greyed out in the left pane?
SWIFT convert NSTimeInteval to NSDate
BLE scanning is stopped when go to background?
Drawing a Rect on UIView
HLS playback via local HTTP server on iOS
Re-Assigning SKScene delegate protocol
Network lost on screen lock unlock
Annoying Xcode Error "file not found" #import
CoreData not firing faults
iOS:How do you change a view size/origin from another view controller class?
Changing a frame in viewDidLayoutSubviews
Animate multiple shapes in UIView
Add NSIntegers ONLY when 2nd NSInteger Changes Value
Facebook SDK, fetching friends
How to get Storyboard to support dynamically sized cells in UICollectionView?
GCD / NSOperationQueue EXC_BAD_ACCESS
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.