Affichage des articles dont le libellé est Active questions tagged iphone - Stack Overflow. Afficher tous les articles
Affichage des articles dont le libellé est Active questions tagged iphone - Stack Overflow. Afficher tous les articles

mardi 30 juin 2015

connect iPhone to Wifi enabled controller

I want to connect my iphone to wifi module residing inside a controller. can anyone tell me how i can make peer to peer connection with a wifi enabled controller.

I googled different communities and forums but couldn't get definitive answers.

Note:

1) There is no bluetooth or bluetooth smart available in controller.

2) Controller usually takes command from mobile phone and helps in operating home appliances.

Windows Phone Store & iPhone app store charges for listing app?

I would like to open account in windows phone store. What is the account opening fee. Is it one time fee or I had to pay annualy. Finnaly any discount available for opening account.

how to hide the status bar in iOS7?

In my application in ios8 status bar is hiding.But in iOS7 displaying the status bar. I have added the "Status bar is initially hidden = YES View controller-based status bar appearance = NO " and

[[UIApplication sharedApplication] setStatusBarHidden:YES
                                        withAnimation:UIStatusBarAnimationFade];

But getting the status bar.

Launch Apple Watch messages app from within another watchKit app

I want to launch the messages app on the Apple Watch from my own WatchKit app. I've seen this post here, but it only tells me to forward the app launch to the iPhone.

In the delegate method of the iPhone app, I can now perform a URL action. What's the URL I have to use in order to launch the messages app on the watch?

WatchKit Xcode 7.0 Beta 2 Build Error / Circular Segues / "exit code 255"

While working on a project for WatchKit 2 on XCode 7.0 beta 2, I have encountered the following build errors: enter image description here

Command /Applications/http://ift.tt/1CxB2sU failed with exit code 255

error: The folder “Interface.wkstoryboardc” doesn’t exist.

I had a storyboard with segues from view 1-2-3-4, with a final segue back from view 4-1. Each views controller had one button with a segue to the next view in the list.

enter image description here

Removing the segue from view 4 to 1 caused this error to go away. If this were an iPhone project, I would use an unwind segue. However, I cannot see how to do this on the watch. Has anyone else seen this behavior? Is this expected behavior, or a bug?

iOS App crashes on WLAN disconnect

I am facing a strange problem with my iOS app. It is written in Objective-C and i use iOS 8.3 on my testdevice (iPhone 4s). The app uses push notifications.

When I lock my iPhone, I sometimes get the following issue: Before unlocking the device again, the wlan status symbol in the status bar disappears and when I finally unlock it, the app freezes and I have to restart it (-> The WLAN sign returns and the app works without any problems)

How can I update a tableview cell from a -(void) method?

I am trying to update a specific dynamic cells font size from a -(void) method or some way without using cellForRowAtIndexPath. Is this possible?

Thanks

IBInspectable - Exposing the controls of a parent class

I want to create a IB_DESIGNABLE UIButton class to control the roundness of its corners but as stated by this question in order to control the button roundness I must change the corners of the button's view. In that case the poster creates a category.

I want to use the idea and create a UIButton class where I can control that.

But this is my problem: in order to Interface Builder show the exposed properties I have to create a UIButton class and assign that class to the button.

UIButtons inherit from UIView. The properties I want to expose are from UIView but that has to be done from the button class.

Any way to do that?

TableView with row inset

Is it possible to create such tableView?

enter image description here

It will have inset from first 2 row and the other row will be in full string

Can I resize a GADBannerView?

I'm using a custom GADBannerView in my application. Currently I'm getting the following frame.

<GADBannerView: 0x7fd146f9d8a0; frame = (0 0; 640 260); clipsToBounds = YES; layer = <CALayer: 0x7fd1455a2880>>

Can I resize the frame to 320x130? If I resize it I get a "No ads to display" error. If I keep it the original size I receive ads.

Is there is any way to change the size of GADBannerView?

Touch ID integration on iOS app

I am developing a new iOS app, on that if the user is idle for some time the app become locked and need to authenticate using Touch ID or password. This is the first time I am working with touch ID. Now I am facing some issues, they are :

  1. Can I use the Touch ID of my iPhone and the password of my app to unlock the app ? (That is when the app become locked the authentication alert will show, user can authenticate using Touch ID, or if the user taps on the "Enter password" option I need to navigate to another page of my app where the user authentication done by using the app password)
  2. Is it possible to remove the "cancel" button from the touch ID alertview ?
  3. On the first time the "Enter password" option on the touch ID alert is not showing. When I entered a wrong touch ID then from the next time onwards the Enter password option is displayed. (I didn't set any value for "localizedFallbackTitle")

Thanks in advance.

Why storyboard popover not working on device in Swift?

I have crated popover using storyboard, it working fine on simulator, But I am getting error on device, app get crash on device while popover

I am testing this on IOS7 device

Is there any solution for that?

Library to read and write XML in Objective C

I am new in IPhone developer(objective c) and I would like to know what is the best library to write and read XML file.

Dynamically change UIView frame and subview frame

I came across a problem when dealing with dynamically changing UIView's and subview's frame. Here is my below code.

I have 3 UI elements created in xib. dynamicView, dynamicLabel and a button. On button click, I am trying to resize the UIView's frame and UILabel's frame.

#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UILabel *dynamicLabel;
@property (weak, nonatomic) IBOutlet UIView *dynamicView;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    self.dynamicLabel.backgroundColor = [UIColor redColor];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)changeFrame:(id)sender {
    self.dynamicView.frame = CGRectMake(2, 2, 60, 60);
    //[self.dynamicView addSubview:self.dynamicLabel];
    self.dynamicLabel.frame = CGRectMake(0, 0, 30, 20);
}
@end

As per the code, the expected result is, the dynamicView resize to (2, 2, 60, 60) and the dynamicLabel which is a subview of dynamicView, resize to (0, 0, 30, 20) with respect to its superview, dynamicView. But in the actual result, dynamicView is resized correctly and dynamicLabel is resized with respect to self.view. Attached the screenshot. enter image description hereenter image description hereenter image description here

What am I missing to bring the expected result?

iPHONE: QR CODE GENERATION

I have a requirement to generate a QR code image which will return a string when scanned. I have completed the scanning of QR code.I need some suggestion on how to generate a QR IMAGE in Iphone.

how to calculate difference between two times in different dates in iOS?

starttime= 23:00 pm end time= 5:00 am

I need the summing time of the start time to end time i am trying this code but it is not helpful to me

NSDateFormatter *formatter = [NSDateFormatter new];
        [formatter setDateFormat:@"HH"];

        NSDate *currentTime = [NSDate date];
        NSDate *openTime = [formatter dateFromString:start];
        NSDate *closeTime = [formatter dateFromString:end ];
        NSCalendar *calender = [NSCalendar currentCalendar];
        NSDateComponents *currentTimeComponents = [calender components:NSHourCalendarUnit|NSMinuteCalendarUnit|NSSecondCalendarUnit fromDate:currentTime];
        NSDateComponents *openTimeComponents = [calender components:NSHourCalendarUnit|NSMinuteCalendarUnit|NSSecondCalendarUnit fromDate:openTime];
        NSDateComponents *closeTimeComponents = [calender components:NSHourCalendarUnit|NSMinuteCalendarUnit|NSSecondCalendarUnit fromDate:closeTime];

        NSUInteger currentTimeSeconds = currentTimeComponents.hour;

        NSUInteger openTimeSeconds = openTimeComponents.hour;

        NSUInteger closeTimeSeconds = closeTimeComponents.hour;

        if (currentTimeSeconds>openTimeSeconds && currentTimeSeconds<closeTimeSeconds) {
            NSLog(@"Time Between Open and Close Time %lu",(unsigned long)currentTimeSeconds);
        }

and it shows 0 hors. please help me some one? thanks in advance

UISplitViewController's preferredDisplayMode: incorrect behavior

I have a master-detail application (I created it using the Xcode template, and then I modified it a bit), and I'm trying to set the preferredDisplayMode property of UISplitViewController to obtain this behavior:

UISplitViewControllerDisplayMode.PrimaryOverlay: The primary view controller is layered on top of the secondary view controller, leaving the secondary view controller partially visible.

So the master view controller should initially be on top of the detail view controller, and it should be possible to dismiss it. I change this property in application:didFinishLaunchingWithOptions:, that's the full code:

 
// Inside application:didFinishLaunchingWithOptions:
// Override point for customization after application launch.
let rootViewController = window!.rootViewController as! UINavigationController
// The root view controller is a navigation controller that contains the split view controller
let splitViewController = rootViewController.viewControllers[0] as! UISplitViewController


let navigationController = splitViewController.viewControllers[splitViewController.viewControllers.count-1] as! UINavigationController navigationController.topViewController.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem() splitViewController.delegate = self


splitViewController.preferredPrimaryColumnWidthFraction = 0.4 splitViewController.maximumPrimaryColumnWidth = 600 splitViewController.preferredDisplayMode = .PrimaryOverlay


return true

I have two problems: first, that's not the behavior that I obtain. The master view controller is hidden when the application launches, and if I click on the left bar button item to show the master, it rapidly appears and then disappears again. If I click it another time it appears without disappearing.
Second, I get a warning in the console:

2015-06-30 12:06:26.613 Presidents[29557:857547] Unbalanced calls to begin/end appearance transitions for <UINavigationController: 0x7b8be610>.

But I have no transitions in my code.

PS: It's from the book "Beginning Phone Development with Swift" by D. Mark, J. Nutting, K. Topley, F. Olsson, J. LaMarche, chapter 11.

Can I use the default image editor available in my iOS app?

I want to implement an image editing functionality similar to the native one provided by Apple in iPhones. Is it available to use inside the app? If not then is there any similar library available?

Testing IOS apps on ios devices made using IONIC and angularJS

I am making an app made using IONIC which i just want to test on my IOS device - not publish it to the app store. Do i still need a Apple developer account ( by paying $99 ) or is just a MAC with XCODE and IONIc installed enough?

I just want to test it on my device, not publish it to the app store.

Type 'ViewController' does not conform to protocol 'MPMediaPlayback'

I got this error message when trying to develop video player.

/Users/MNurdin/Documents/iOS/SwiftVideoPlayer/SwiftVideoPlayer/ViewController.swift:12:1: Type 'ViewController' does not conform to protocol 'MPMediaPlayback'

My code

import UIKit
import MediaPlayer

class ViewController: UIViewController, MPMediaPlayback { //error message here

    var isPreparedToPlay: Bool = true
    var currentPlaybackRate: Float = 0.0
    var currentPlaybackTime: NSTimeInterval = 0.0

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    func play() {

    }

    func pause() {

    }

    func stop() {

    }

    func prepareToPlay() {

    }

    func beginSeekingBackward() {

    }

    func beginSeekingForward() {

    }

    func endSeeking() {

    }

}

What I'm missing here? Please advice. Thank you.

Source code: http://ift.tt/1eXutLp

Reference: http://ift.tt/1FN2ovh