Pages

Wednesday 31 December 2014

'UITextAlignmentCenter' is deprecated: first deprecated in iOS 6.0



label.textAlignment = UITextAlignmentCenter; //warning gives in it
To solve that issue
In iOS6 and above  we can use 
label.textAlignment = NSTextAlignmentCenter;//simply replace UITextAlignmentCenter by NSTextAlignmen

Tuesday 30 December 2014

Declaration of 'struct sockaddr_in' will not be visible outside of this function




Apple complier gives the warning (Declaration of 'struct sockaddr_in' will not be visible outside of this function) in reachability class file

+ (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress;



To Resolve the issue just simply

Add #import <netinet/in.h> in Reachability.h to get away with this

Monday 29 December 2014

'dismissModalViewControllerAnimated:' is deprecated: first deprecated in iOS 6.0

"dismissModalViewController" that method is deprecated in iOS 6.0,so Xcode gives warning when your build run on iOS 6.0 and above version..

so simply we can resolve that warning as


Replace

[self dismissModalViewControllerAnimated:YES];

To

[self dismissViewControllerAnimated:YES completion:nil];

Sunday 28 December 2014

'presentModalViewController:animated:' is deprecated: first deprecated in iOS 6.0










"presentModalViewController" that method is deprecated in iOS 6.0,so Xcode gives warning when your build run on iOS 6.0 and above version..

so simply we can resolve that warning as


Replace

[self presentModalViewController:MenuVC animated:YES completion:nil];

To

[self presentViewController:MenuVC animated:YES completion:nil];

Saturday 27 December 2014

Implicit conversion loses integer precision: 'NSInteger' (aka 'long') to 'int'

If you add 64bit support to your app (arm64 architectures added)you may notice a compiler warning when you do this:
Implicit conversion loses integer precision: ‘NSInteger’ (aka ‘long’) to ‘int’
Your code still works.
But resolve that warning ,We can use typecasting...

e.g.code

int count = [myColors count]; 
//that gives warning as "Implicit conversion loses integer precision :"NsInteger' (aka 'long') to 'int'

simply typecast  as follows

int count = (int) [myColors count];//simply typecast this and warning will be resolve







Friday 26 December 2014

REST client ( development tool)





Following are two rest client, its development tool to test the rest API and lot more.


1]
https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo

Features:
- Integrated with Google Drive
- It's own backend service to store and share data between coworkers
- convenient HTTP headers and payload editor thanks CodeMirror
- Make a HTTP request (via XmlHttpRequest level 2)
- Debug socket (via web socket API).
- JSON response viewer
- XML response viewer
- set custom headers - even does not supported by XmlHttpRequest object
- help with filling HTTP headers (hint + code completion)
- add headers list as raw data or via form
- construct POST or PUT body via raw input, form or send file(s) with request
- set custom form encoding
- remember latest request (save current form state and restore on load)
- save (Ctrl+S) and open (Ctrl+O) saved request forms
- history support
- data import/export 
 
 


2]
https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm


use the crome to use this development too (its web app tool for crome)

**Features**

*Create requests quickly*
- Compact layout
- HTTP requests with file upload support
- Formatted API responses for JSON and XML
- Open responses as an HTML file in a new window
- HATEOAS support
- Image previews
- Request history
- Basic and OAuth 1.0 helpers
- Autocomplete for URL and header values
- Key/value editors for adding parameters or header values. Works for URL parameters too.
- Use environment variables to easily shift between settings. Great for testing production, staging or local setups.
- Use Global variables for values which are common throughout APIs
- Use the quick look feature to preview variables and their values before you use them
- Keyboard shortcuts to maximize your productivity 
 
 



Thursday 25 December 2014

For json view and validate




This two site is very useful to view the json kind of data ,and check whether is valid or not.


Following are two site

1] http://jsonviewer.stack.hu/


2] http://jsonlint.com/


You can chose which you like or feels very good to json view or validate it.

Wednesday 24 December 2014

iOS interview questions

Questions :
1.What is latest iOS version?
2.What is latest Xcode version?
3.What is latest mac os version , and tell the Mac os Name as well?
4.What is iPad screen sizes?
5.what is iPhone screen sizes?
6.What are the features is iOS  7 and iOS 8?
7.Who invented Objective c?
8.What is Cocoa and cocoa touch?
9.What is Objective c?
10. how declare methods in Objective c? and how to call them?
11. What is property in Objective c?
12.What is meaning of "copy" keyword?
13.What is meaning of "readOnly" keyword?
14.What is meaning of "retain" keyword?
15.What is meaning of "assign" keyword?
16.What is meaning of "automic" keyword?
17.What is meaning of "nonautomic" keyword?
18.What is difference between "assign" and "retain" keyword?
19.What is meaning of "synthesize" keyword ?
20.What is "Protocol" on objective c?
21.What is use of UIApplication class?
22.What compilers apple using ?
23.What is synchronized() block in objective c? what is the use of that?
24. What is the "interface" and "implementation"?
25.What is "private", "Protected" and "Public" ?
26. What is the use of "dynamic" keyword?
27.What is "Delegate" ?
28.What is "notification"?
29.What is difference between "protocol" and "delegate"?
30.What is "Push Notification"?
31.How to deal with SQLite database?
32.What is storyboard? 
33.What is Category in Objective c?
34.What is block in objective c?
35. How to parse xml? explain in deep.
36.How to parse JSON? explain in deep.
37.How to use reusable cell in UITableview?
38.What is the meaning of "strong"keyword?
39.What is the meaning of "weak" keyword?
40.What is difference strong and  weak reference ? explain.
41.What is ARC ? How it works? explain in deep.
42. What manual memory management ?  how it work?
43. How to find the memory leaks in MRC?
44.what is use of NSOperation? how NSOperationque works?
45.How to send crash report from device?
46.What is autorealease pool?
47.What happens when we invoke a method on a nil pointer?48.Difference between nil and Nil.
49.What is fast enumeration?
50. How to start a thread? explain in deep.
51.How to download something from the internet?
52.what is synchronous web request and asynchronous ?
53. Difference between sax parser and dom parser ?
54.Explain stack and heap?
55.What are the ViewController  lifecycle in iOS?
56.Difference between coredata & sqlite?
57.Steps for using core data?
58.Procedure to push the app in AppStore?
59.What are the Application lifecycle in iOS?
60.Difference between release and autorelease ?
61.How to start a selector on a background thread
62.What happens if the methods doesn’t exist
63.what happens if you remove   the object from the array, and   you try to use it? 
64.Difference between HTML & XML?
65.What are iOS SDK Tools?
66.what are the Delegate Methods for XML Parsing?
67.What is XML parsing?







follow other blog as well for iOS interview and questions














Tuesday 23 December 2014

Sent APK file to client




Sendspace

this one is good website to share the Android file (.apk)  to client and even we can share as well big file.

https://www.sendspace.com

Monday 22 December 2014

send ipa file to client


There is two best site to send the build (.ipa ) file to client

1] diawi (www.diawi.com)-

Diawi is a tool for iOS developers to deploy Development and Ad hoc iOS applications directly to the device.

1. Upload the application and its provisioning profile.2. Send the link to your testers, clients, friends or even use it yourself.3. Open the link in Safari on the iOS device and click on install.
After the upload, Diawi creates a unique short URL to access the installation page (for ex: aBcDeF). When opened in Safari on the iOS device, the page will display a link to install the application.
This features allows to quickly deploy applications to testers, clients, medias, bloggers or friends without the need to send large files by e-mail.
The installation using Diawi is a lot easier than through iTunes or the iPhone Configuration Utility : a simple URL and only 1 tap is needed.






        Diawi is based on Apple's wireless distribution model introduced in iOS 4 to allow development application installation without iTunes or even a computer.



2] Testflight  (http://www.testflightapp.com)-

TestFlight is a free platform used to distribute beta and internal iOS/Android applications to team members over-the-air. Developers can manage beta testing campaigns and receive feedback from their team with TestFlight's dashboard. With theTestFlight SDK implemented in an application, (https://www.testflightapp.com/sdk/) users can acquire more metrics on how and what testers are doing when testing an application on their device. The SDK works for both beta versions and live versions available in the App Store.












Sunday 21 December 2014

App icon test and generator for ios

I found that two useful website which you easily can test your icon and generate in different size also


these are as folllows

1]appsparky

This link ( http://www.appsparky.com/app-icon-test-upload-icon ) , just upload (or drag drop) the icon image 1024*1024 or 2048*2048.
so after process it will show , how your app icon look like on App store (for ipad / for iphone ) and
even simulate on this on device (ipad /iphone)
(this is  good website to test and generate icon)

2]http://ticons.fokkezb.nl
This website very useful to generate icon. and plus thing is generate the splash-screen (default screen /launch screen /loading screen) as well. For iOS and Android as well.



Some refrance link for get to know the app icon size required

for ios
https://developer.apple.com/library/ios/qa/qa1686/_index.html

for both (ios and android)
http://www.gieson.com/Library/projects/utilities/icon_slayer/#.VJUAb6CUk

for android
http://developer.android.com/design/style/iconography.html






TextField Validation for iOS



I found that custom class for text filed  validation in iOS ,i will explain you in shortly.

demo code is available free on github, you can download URL:https://github.com/dhawaldawar/TextFieldValidator

Follow the steps to add text filed validatore 

1. Include “TextFieldValidator.h” & “TextFieldValidtor.m” file in your project.

2. Add error icon file (image file)in project (you can find this image file from that demo and that class file as well).

3. if you added text filed control in your project , then you  must have to assign the custom class to it as "TextFieldValidator" (in property  .and create outlet or create instance programmatically.

4.Must assign text filed to “presentInView” . If you are managing text field from storyboard/xib then you can directly assign outlet of “presentInView” to any view.

5
below validations regex to all above textfields
// Add regex for validating characters limit
[txtUserName
 addRegx:@”^.{3,10}$” withMsg:@”User name charaters limit should be come between 3-10″];
// Add regex for validating alpha numeric characters
[txtUserName addRegx:@”[A-Za-z0-9]{3,10}” withMsg:@”Only alpha numeric characters are allowed.”];
// Add regex for validating email id
[txtEmail addRegx:@”[A-Z0-9a-z._%+-]{3,}+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}”withMsg:@”Enter valid email.”];
// Add regex for validating characters limit[txtPassword addRegx:@”^.{6,50}$” withMsg:@”Password characters limit should be come between 6-20″];
// Add regex for validating alpha numeric characters[txtPassword addRegx:@”[A-Za-z0-9]{6,20}” withMsg:@”Password must contain alpha numeric characters.”];
// Add regex for validating confirm password text with the password field   
[txtConfirmPass addConfirmValidationTo:txtPassword withMsg:@”Confirm password didn’t match.”];
// Add regex for validating phone number
[txtPhone addRegx:@”[0-9]{3}\\-[0-9]{3}\\-[0-9]{4}” withMsg:@”Phone number must be in proper format (eg. ###-###-####)”];
// To set phone number is not mandatory
txtPhone.isMandatory=NO;
Now if tap on “Submit” button then error will show for text fields according to the validation that failed
if([txtUserName validate] & [txtEmail validate] & [txtPassword validate] & [txtConfirmPass validate] & [txtPhone validate]){
       //Success and now you can redirect the to another view
}



 For more info , get in touch with this blog. and i am very thankful to  Dhawal Dawar for writing this article and coding this  ( http://www.thinkotech.com )

Friday 19 December 2014

generate the splash-screen (default screen /launch screen /loading screen) For iOS and Android





http://ticons.fokkezb.nl
This website very useful to generate icon. and plus thing is generate the splash-screen (default screen /launch screen /loading screen) as well. For iOS and Android as well.

App icon generator for Android

I found that  useful website which you easily can icon generate in different sizes


http://ticons.fokkezb.nl
This website very useful to generate icon. and plus thing is generate the splash-screen (default screen /launch screen /loading screen) as well. For iOS and Android as well.



Some refrance link for get to know the app icon size required

for both (ios and android)
http://www.gieson.com/Library/projects/utilities/icon_slayer/#.VJUAb6CUk

for android
http://developer.android.com/design/style/iconography.html

How to create and manage login session in iOS






1] In login page , if Login is Successful then i stored my Username & Password in NSUserDefault
as follows
Onclick of Login Button.

 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
     [defaults setObject:userNameText forKey:@"username"];               
     [defaults setObject:passWordText forKey:@"password"];
     [defaults synchronize];
// Redirected to another viewController .


2] if user click Logout then  Delete All Data as follows.
Onclick of LogOut Button.
 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    [defaults removeObjectForKey:@"username"];
    [defaults removeObjectForKey:@"password"];
    [defaults synchronize];
 // Redirected to Main viewController or Login viewController .

And then

3] in case when user close app and  second time open app at that time , then we need to  check wheather username & password stored in NSUserDefault During ViewDidAppearof Loginpage.
ViewDidAppear of Loginpage.

   NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

    // check if user Login already
    if([defaults objectForKey:@"username"]!=nil  && ![[defaults objectForKey:@"username"] isEqualToString:@""])
    {
        // Redirected to viewController.
  

    }