w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
  Home » IOS » Page 2
MDM profile installation failed in iOS sdk
Can you try to access your webserver from mobile Safari? In the case, if it will show you a dialog that website isn't trusted then you didn't install a certificate for your webserver to trusted CA storage. You will need to Create a config profile (usnig IPCU) Choose "Credentials" Add you certificate Install it on a device

Categories : IOS

Swift, creating a Generic UIViewController
As mentioned in OP comments, Generic class cannot be properly represented in Objective-C. The workaround would be using the class as a property. something like this: class MyClass: UIViewController{ let viewCls:UIView.Type init(viewCls:UIView.Type = UIView.self) { self.viewCls = viewCls super.init(nibName: nil, bundle: nil); } required init(coder aDecoder: NSCo

Categories : IOS

Using iOS 8 features on iOS 7 phones, hidesBarsOnSwipe
It will crash on iOS 7 because UINavigationController doesn't respond to setHidesBarOnSwipe: selector (the method is implemented only on iOS 8 or newer). You can add a safety check: if([nc respondsToSelector:@selector(setHidesBarOnSwipe:)]) { ns.hidesBarOnSwipe = YES; } else { // use your old hack if you want to }

Categories : IOS

List of connected devices to local wifi network
One way to realize this is pinging all IP addresses in your WLAN. If you get response from an IP address, you find a neighbour. It's simple but slow, and may miss the device which refuse to respond to ping.

Categories : IOS

iOS 8 UIImagePickerController to take photos only photos
https://developer.apple.com/library/ios/documentation/uikit/reference/uiimagepickercontroller_class/index.html#//apple_ref/c/tdef/UIImagePickerControllerCameraCaptureMode cameraUI.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;

Categories : IOS

IOS remote silent notification is not working during phone calls / network fluctuation
I believe just because you are sending a silent notification, doesn't mean that the application will get notified straight away. From my observations using a GSM iPhone. Whenever I am on a Phone Call the Cellular Data type drops a band e.g. LTE -> 3G, 3G -> EDGE etc. So the data network is not reliable. You also state that it does not happen during network fluctuation, the system has recieved th

Categories : IOS

Swift - Get last 7 days starting from today in array
It's might not be the fastest code. But you get the idea :) import Foundation let lastSevenDay: [Int] = { var days = [Int]() let secondsInADay: NSTimeInterval = 24 * 60 * 60 let now = NSDate() let calendar = NSCalendar(calendarIdentifier: NSGregorianCalendar)! for i in 1...7 { let theDate = now.dateByAddingTimeInterval(-secondsInADay * NSTimeInterval(7 - i)) l

Categories : IOS

iOS : Unable to import CoreWLAN framework in iOS8
Since this question is tagged with the iOS tag, you're presumably trying to import CoreWLAN for an iOS project, which isn't possible. You can use the SystemConfiguration framework if all you're trying to do is access the name of the currently connected network. See the Apple Documentation for more.

Categories : IOS

how to move Text Field above my toolbar which is added above key board
Create an instance variable for the height of the keyboard accessory view (e.g. float accessoryViewHeight), and set it when the accessory view is created. Then, in the code you posted, use the kbSize + the accessoryViewHeight in place of kbSize.height. Example: ... CGSize kbSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size; float totalKBHeight = kbSize.height + acces

Categories : IOS

collectionView:cellForItemAtIndexPath: why my view has zero subviews?
I try to simulate a similar project and I had the same issue (my prototype cell wasn't used). Be sure that you don't have any self.collectionView.registerClass(UICollectionViewCell, forCellWithReuseIdentifier: reuseIdentifier) or self.collectionView.registerClass(DataItemCollectionViewCell, forCellWithReuseIdentifier: "DataItemCell"DataItemCollectionViewCell) anywhere in your code.

Categories : IOS

Getting statistics for app functions usage
Select your log file uploaded --> Search for a particular even from the search bar --> you will see all the listed event logs --> Now click on the Arrow next to any one of these logs --> Select event actions --> Extract fields. Now in the Example values for a Field section put few of your function names and click generate. Splunk will understand your requirements and list all the logs associated w

Categories : IOS

Swift, return value from asynchronous block
Your Swift class User needs to implement the Printable protocol so that it can be used by println. Something like this: Class User: Printable { let name = "Bob" var description: String { return "User: (name)" } } Read more in this Apple post If you are feeling lazy, make your User class a subclass of NSObject which already implements the Printable protocol Edit A quick search of

Categories : IOS

Xamarin change page from a renderer Button
A nice way to do this would be to combine your custom renderer with a custom button view. Your custom view could have a swipe event to which you can subscribe. Of course, you could create a custom delegate if necessary as well, to pass custom event data, but I've kept this example simple. public class CustomButton : Button { public event EventHandler OnSwipeUp; public void FireSwipeUp()

Categories : IOS

iOS: How to find the latest auto-renew/purchase info from the in-app purchase receipt
Hi, Finally i found the answer. Actually, you need to parse the entire receipt which was received from apple's itunes server and from that you can know the latest purchased receipt by comparing the previous purchased receipt expire time and the next purchased receipt expire time. You need to do this until you reach end of receipt.

Categories : IOS

Can data model be changed in CloudKit after App is in App Store and Container is in production mode?
During development, you can make any changes you need. When you deploy to the Production environment, Apple warns you: After the schema is deployed, you won't be able to remove Production types or attributes in Development. So you can add types and attributes, you just can't remove them. You can also add and remove indexes.

Categories : IOS

Transition between different points of views (SCNCameras) in SceneView
changing the pointOfView of the view is the easiest way. But if you want to control the path you will have to move the camera yourself. You can do that with SCNAction or by using CoreAnimation explicit or implicit animations.

Categories : IOS

How do I extend a NSManagedObject to contain MKAnnotation in Swift?
You cannot have stored properties, but you can have calculated properties! I.e: var coordinate : CLLocationCoordinate2D { get { return CLLocationCoordinate2D(latitude: 10.0, longitude: 10.0) } }

Categories : IOS

Sorting of a UITableView with custom Objects
You should implement compare: method in your Person class and then call this method on the array holding the data: NSArray * sortedPersonArray = [personArray sortedArrayUsingSelector:@selector(compare:)]; Regarding the compare: implementation: - (NSComparisonResult)compare:(Person *)person{ if (self.Age > person.Age) { return NSOrderedDescending; }else if(self.Age < perso

Categories : IOS

Core Data adding new ViewController (Lynda tutorial)
If you want to change the initial view controller just import that view controller and create the instance of the view controller and replace it with the PersonTableTableViewController instance. Lets say you want to have PersonListTableViewController as initial view controller then you can initialise like this, go to the storyboard and replace the navigationcontroller's rootviewcontroller to Perso

Categories : IOS

How do I reset an array in Swift when the user taps "Play Again"
The easiest solution would be to have a method that returns the initial version of the array then when you are finished or play again is called you can set the array using that method. Alternatively you can create a 2nd array that holds your initial array data (copy of course) then remove the objects from the 2nd array. Once you hit play again just copy your initial array data back to the 2nd arr

Categories : IOS

Unable to create UINavigationController
You should be sure that you are created detailViewController before assign to NavControler. // You must: UIViewController *detailViewController = [[UIViewController alloc] init]; UINavigationController *navController=[[UINavigationController alloc]initWithRootViewController:detailViewController]; If you are using storyBoards, add as star viewController a UINavigationController and con

Categories : IOS

Modal transition style like in Mail app
I'm pretty sure this is your answer - Page sheet - as in UIModalPresentationPageSheet https://developer.apple.com/library/ios/documentation/userexperience/conceptual/mobilehig/Alerts.html#//apple_ref/doc/uid/TP40006556-CH14-SW3

Categories : IOS

Error handling for adbannerview effect App Store review?
This helped me: http://codewithchris.com/iad-tutorial/ Search the callbacks bannerViewDidLoadAd and didFailToReceiveAdWithError.

Categories : IOS

Set useragent in WKWebview
As noted in my comment you can use the same approach as described here: Change User Agent in UIWebView (iPhone SDK) Now if you want to get the user agent you need to have an instance of a WKWebView and evaluate this javascript on it: navigator.userAgent The problem is that if you set a custom user agent after a WKWebView has been instantiated you will always get the same user agent. To solve t

Categories : IOS

NSURLSession malloc_error
To be honest, this looks like a iOS 8.1 bug :( I used to get this error in the past, working with a non-ARC project, when I used release twice accidentally on an attribute, so it's probably the application complaining that you're trying to free a section of the heap that has no allocated memory. Since not only you're using ARC and not freeing memory directly, but also you're getting this error ran

Categories : IOS

correctly convert hex to base64
If you have a hex string that represents an image, you simply want to convert that hex string to a NSData NSString *hexadecimalString = ... NSData *data = [hexadecimalString dataFromHexadecimalString]; self.imageView.image = [UIImage imageWithData:data]; Where dataFromHexadecimalString might be defined in a NSString category like so: @implementation NSString (Hexadecimal) - (NSData *)dataFrom

Categories : IOS

return CGRect on selector causes crash
In objective-C you can not return CGRect. so you have to CGRect convert into NSValue. so you get the crash report. This is a fundamental limitation of Objective-C — a variable cannot sometimes hold an object and sometimes a primitive value. The best workaround is to return an NSNumber or NSValue object wrapping the real value you want to return.

Categories : IOS

How to create a text child without tag using GDataXml
You can creat a text without tag by using method: (id)textWithStringValue:(NSString *)value as the following: GDataXMLElement * pElement = [GDataXMLElement elementWithName:@"p"]; [pElement addChild:[GDataXMLNode textWithStringValue:@" First string child "]]; [pElement addChild:[GDataXMLNode elementWithName:@"a" stringValue:@"link"]]; [pElement addChild:[GDataXMLNode textWi

Categories : IOS

Detect when url containing local anchor tag is clicked on UIWebView?
I don't exactly follow what you're trying to do, perhaps you could clarify a bit more. In the meantime, here's how to get your UIWebView to handle every link click in the web page it has loaded. It's looking for a URL Scheme that begins with "bloodwing". If it finds it, it will stop the request. Otherwise, it will work as expected. So http://www.yahoo.com will work, and bloodwing://www.yahoo.

Categories : IOS

iOS code to dismiss a View with countdown
Putting this Code into your bubble view Controllers viewDidLoad or similar and it will dismiss itself after 30 seconds: dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(30 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self dismissViewControllerAnimated:YES completion:nil]; });

Categories : IOS

How to save and fetch one Object from Database in Swift?
You can do as following. //For storing only one object, func saveConfiguration (config : ConfigDao){ let entity = NSEntityDescription.entityForName("AppConfig", inManagedObjectContext:self.del.managedObjectContext!) var fetchRequest = NSFetchRequest (entityName: "AppConfig") if let fetchResults = del.managedObjectContext!.executeFetchRequest(fetchRequest, error: nil) a

Categories : IOS

Get Facebook user's page likes iOS
I got my answer and this is how I made it happen: //Page likes /* make the API call */ [FBRequestConnection startWithGraphPath:@"me/likes?limit=10" parameters:nil HTTPMethod:@"GET"

Categories : IOS

Reload UITableView Header View without blink
Hmm probably you should use this approach try to indicate when you start and end update of table view : [self.tableView beginUpdates]; [self.table reloadSections:indexSet withRowAnimation:UITableViewRowAnimationNone]; [self.tableView endUpdates];

Categories : IOS

How to split NSArray into NSDictationary by param
Pseudo code : result = new mutable dictionary for each (object in array) age = object[@"age"] if (result[age] does not exist) result[age] = new mutable array append object to result[age] Voilà.

Categories : IOS

Should I use copy or strong with arrays?
Its simple, Consider somewhere in your view controller NSArray *myArrayCopy = self.myArray Now If myArray is strong then if you change some object in myArrayCopy myArray will automatically changed. while in case of copy it would not changed as it will assign copy of myArray to myArrayCopy.

Categories : IOS

Compile time Error libxml2.dylib
try this 1-In target Build Settings, Linking -> Other Linker Flags, add -lxml2 2-In target Build Settings, Search Paths -> Header Search Paths, add $(SDKROOT)/usr/include/libxml2 3-In target Build Phases, Link Binary With Libraries, add libxml2.dylib

Categories : IOS

WMTS protocol and MapKit
No it does not natively. You can use an library called Route Me on github. It is a BSD license. https://github.com/Alpstein/route-me

Categories : IOS

PKPaymentAuthorizationViewController present as nil view controller
Did you implement these methods to check before trying to present the viewcontroller? // Determine whether this device can process payment requests. // YES if the device is generally capable of making in-app payments. // NO if the device cannot make in-app payments or if the user is restricted from authorizing payments. + (BOOL)canMakePayments; // Determine whether this device can process paymen

Categories : IOS

Instagram API Implementation failed in iOS
The error is pretty explicit: the webview could not load the URL ige99d3bcd754b49b6ad543375c4a3edaa://authorize#access_token=1558091028.e99d3bc.889f10ef7ff64fc8938ed6de9d8978f8. There are fundamental problems with how you're attempting to construct and parse URLs. Take a moment to revisit the documentation for NSURL and NSURLComponents.

Categories : IOS




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.