I’ve been interviewing alot of people recently for iPhone and iPad developer positions. Asides from algorithm runtime problems, I ask some general iOS questions. So being the kind person I am posting some questions based on difficulty and expected answers.
BEGINNER
- Q: How would you create your own custom view?
A: Subclass the UIView class.
- Q: Whats fast enumeration?
A: Fast enumeration is a language feature that allows you to enumerate over the contents of a collection. (Your code will also run faster because the internal implementation reduces message send overhead and increases pipelining potential.)
- Q: Whats a struct?
A: A struct is a special C data type that encapsulates other pieces of data into a single cohesive unit. Like an object, but built into C.
- Q: Whats the difference between a NSArray and a NSMutableArray?
A: A NSArray’s contents can not be modified once it’s been created whereas a NSMutableArray can be modified as needed, i.e items can be added/removed from it.
- Q: Explain retain counts.
A: Retain counts are the way in which memory is managed in Objective-C. When you create an object, it has a retain count of 1. When you send an object a retain message, its retain count is incremented by 1.
When you send an object a release message, its retain count is decremented by 1. When you send an object a autorelease message, its retain count is decremented by 1 at some stage in the future. If an object’s retain count is reduced to 0, it is deallocated.
- Q: Whats the difference between frame and bounds?
A: The frame of a view is the rectangle, expressed as a location (x,y) and size (width,height) relative to the superview it is contained within.
The bounds of a view is the rectangle, expressed as a location (x,y) and size (width,height) relative to its own coordinate system (0,0).
- Q: Is a delegate retained?
A: No, the delegate is never retained! Ever!
INTERMEDIATE
- Q: If I call performSelector:withObject:afterDelay: – is the object retained?
A: Yes the object is retained. It creates a timer that calls a selector on the current threads run loop. It may not be 100% precise time-wise as it attempts to dequeue the message from the run loop and perform the selector.
- Q: Can you explain what happens when you call autorelease on an object?
A: When you send an object a autorelease message, its retain count is decremented by 1 at some stage in the future. The object is added to an autorelease pool on the current thread. The main thread loop creates an autorelease pool at the beginning of the function, and release it at the end. This establishes a pool for the lifetime of the task. However, this also means that any autoreleased objects created during the lifetime of the task are not disposed of until the task completes. This may lead to the task’s memory footprint increasing unnecessarily. You can also consider creating pools with a narrower scope or use NSOperationQueue with it’s own autorelease pool. (Also important – You only release or autorelease objects you own.)
- Q: Whats the NSCoder class used for?
A: NSCoder is an abstractClass which represents a stream of data. They are used in Archiving and Unarchiving objects. NSCoder objects are usually used in a method that is being implemented so that the class conforms to theprotocol. (which has something like encodeObject and decodeObject methods in them).
- Q: Whats an NSOperationQueue and how/would you use it?
A: The NSOperationQueue class regulates the execution of a set of NSOperation objects. An operation queue is generally used to perform some asynchronous operations on a background thread so as not to block the main thread.
- Q: Explain the correct way to manage Outlets memory
A: Create them as properties in the header that are retained. In the viewDidUnload set the outlets to nil(i.e self.outlet = nil). Finally in dealloc make sure to release the outlet.
ADVANCED
- Q: Is the delegate for a CAAnimation retained?
A: Yes it is!! This is one of the rare exceptions to memory management rules.
- Q: What happens when the following code executes?
1
Ball *ball = [[[[Ball alloc] init] autorelease] autorelease];
A: It will crash because it’s added twice to the autorelease pool and when it it dequeued the autorelease pool calls release more than once. - Q: Outline the class hierarchy for a UIButton until NSObject.
A: UIButton inherits from UIControl, UIControl inherits from UIView, UIView inherits from UIResponder, UIResponder inherits from the root class NSObject
- Q: Explain the difference between NSOperationQueue concurrent and non-concurrent.
A: In the context of an NSOperation object, which runs in an NSOperationQueue, the terms concurrent and non-concurrent do not necessarily refer to the side-by-side execution of threads. Instead, a non-concurrent operation is one that executes using the environment that is provided for it while a concurrent operation is responsible for setting up its own execution environment.
- Q: Implement your own synthesized methods for the property NSString *title.
A: Well you would want to implement the getter and setter for the title object. Something like this:1
- (NSString*) title {
2
return title;
3
}
4
- (void) setTitle: (NSString*) newTitle {
5
if (newTitle != title) {
6
[title release];
7
title = [newTitle retain]; // Or copy, depending on your needs.
8
}
9
}
- Q: Implement the following methods: retain, release, autorelease.
A:01
-(id)retain {
02
NSIncrementExtraRefCount(self);
03
04
return self;
05
}
06
07
-(void)release {
08
09
if(NSDecrementExtraRefCountWasZero(self)) {
10
NSDeallocateObject(self);
11
}
12
}
13
14
-(id)autorelease {
15
// Add the object to the autorelease pool
16
[NSAutoreleasePool addObject:self];
17
18
return self;
19
}
Hopefully some of these questions will help someone get a job! :)
These are awesome! Thanks!!! Not just for people looking for a job, but for those of us new to iOS development! I just wish I'd found your site two months ago!!!
ReplyDeleteThis comment has been removed by the author.
ReplyDelete
ReplyDeleteI was looking about the Oracle Training in Chennai for something like this,Thank you for posting the great content..I found it quiet interesting, hopefully you will keep posting such blogs…
Greens Technologies In Chennai
ReplyDeleteI found some useful information in your blog, it was awesome to read, thanks for sharing this great content to my vision, keep sharing..
Greens Technologies In Chennai
let's Jump Start Your Career & Get Ahead. Choose sas training method that works for you. This course is designed for professionals looking to move to a role as a business analyst, and students looking to pursue business analytics as a career. SAS Training in Chennai
ReplyDeleteThe best kits online trainings,thanks for sharing this useful information.
ReplyDeleteOracle Golden Gate
Ruby On Rails
SAP XI
fantastic presentation .We are charging very competitive in the market which helps to bring more Microstrategy professionals into this market. may update this blog microstrategy Training in Chennai
ReplyDeletei gain the knowledge of Java programs easy to add functionalities play online games, chating with others and industry oriented coaching available from greens technology chennai in Adyar may visit. core java Training in Chennai which No1: Greens Technologies in Chennai
ReplyDeleteIt's really helpful for me to understand. Thanks.If anyone wants to Learn visit this page Spring Training in Chennai
ReplyDeleteif learned in this site.what are the tools using in sql server environment and in warehousing have the solution thank .. Msbi Training in Chennai
ReplyDeleteif i share this blog weblogic Server Training in Chennai aims to teach professionals and beginners to have perfect solution of their learning needs in server technologies. weblogic server Training in Chennai
ReplyDeletenice post and site, good work! This article is well written and quite informative. More articles should be written and you have just found a follower.and more visit
ReplyDeletesas online training
TNPSC 813 Village Administrative Officer Recruitment 2015
ReplyDeleteThanks for sharing useful information and it is very helpful...................
GSSSB 2480 Revenue Talati Bharti Recruitment 2016
ReplyDeleteIts really great information i am thank full to this website..........
Assam 2564 Police Constable Recruitment 2016 Apply Online
ReplyDeleteI want to thank you for this informative read; I really appreciate sharing this great............
Great post and informative blog.it was awesome to read, thanks for sharing this great content to my vision.
ReplyDeleteInformatica Training In Chennai
Hadoop Training In Chennai
Oracle Training In Chennai
SAS Training In Chennai
Oracle DBA Online Training Classes With Real Time Support From India
ReplyDeleteSap ABAP Online Training Course Free With Certficate
Oracle SOA Online Training Realtime Support From Hyderabad
Powershell Course Online Training Class From India….
Sap BW Hana Online Training By Realtime Trainer In India
Best Sap Fiori Online Training Institute By Real Time Faculties
I just see the post i am so happy to the communication science post of information's.So I have really enjoyed and reading your blogs for these posts.Any way I’ll be replay for your great thinks and I hope you post again soon...
ReplyDeleteIOS Training in Chennai
Super questions about ISO and this questions has helped our students to clear the interview.thanks for sharing the information and we also provide training for SQl and PLSQL.
ReplyDeleteOracle SQL Frequently Asked Questions
Awesome,
ReplyDeleteThank you so much for sharing such an awesome blog...
iphone training course
mobile app training institutes
mobile application training in hyd
iphone training
Thank you for your post.
ReplyDeletePMP Certification training in Pune
PMP training in pune
PMP Coaching in pune
PMP Classes in pune
PMP Workshop in pune
I really loved reading through this article...
ReplyDeleteGmat Training, Coaching in Hyderabad
TELECOM Protocol Testing Training in hyderabad
Wonderful Blog on recent updates, I have updated my knowledge through your blog, Thanks admin for sharing the recent information.
ReplyDeleteSelenium Training in Chennai
JAVA Training in Chennai
Big Data Training in Chennai
Hadoop Training in Chennai
iOS Training in Chennai
Selenium Courses in Chennai
This post is much helpful for us. This is really very massive value to all the readers and it will be the only reason for the post to get popular with great authority.
ReplyDeleteWeb Designing Course in chennai
Best Web Designing Institute in Chennai
Best web designing course in chennai
web design classes
Web Designing Training Centers in Chennai
web design training chennai
This information is impressive. I am inspired with your post writing style & how continuously you describe this topic. Eagerly waiting for your new blog keep doing more.
ReplyDeleteSpanish Classes in Chennai
Spanish Language Course in Chennai
Japanese Classes in Chennai
Spanish Courses in Chennai
German Language Classes in Chennai
Spanish Institute in Chennai
French Institute in Chennai
German Classes in Chennai
This blog is more effective and it is very much useful for me.
ReplyDeletewe need more information please keep update more.
Salesforce Training in Saidapet
Salesforce Training in Ashok Nagar
Salesforce Training in Nungambakkam
Thanks for sharing this post.Keep sharing more like this.
ReplyDeleteArticle submission sites
Guest posting sites
I would really like to thank you for sharing such an amazing post. It is really useful to me
ReplyDeleteWordpress Course in Chennai | Wordpress Training Chennai | WordPress course | Wordpress Training in Adyar | Wordpress Course in Velachery | Wordpress Course in Tambaram
Very impressive blog! i liked it and was very helpful for me.Thanks for sharing. Do share more ideas regularly.
ReplyDeleteWeb Designing Training in Tnagar
Web Designing Training in Aminjikarai
Web Designing course in Chennai kknagar
Web Designing Training in Sholinganallur
Web Designing Training in Karappakkam
Web Designing Course in Velachery
Thanks for sharing this pretty post, it was good and helpful. Share more like this.
ReplyDeleteAWS Training in Chennai
AWS Certification in Chennai
AWS Training in Velachery
DevOps Training in Chennai
RPA Training in Chennai
Blue Prism Training in Chennai
UiPath Training in Chennai
Keep writing, great stuff with excellent examples. Thank you
ReplyDeleteSelenium Training in Chennai
Selenium Training
iOS Training in Chennai
Digital Marketing Training in Chennai
core java training in chennai
Selenium Interview Questions and Answers
Future of testing professional
cloud computing training in chennai
cloud computing training
It’s always so sweet and also full of a lot of fun for me personally and my office colleagues to search your blog a minimum of thrice in a week to see the new guidance you have got.
ReplyDeleteDotnet Training in Chennai | Dotnet Training course in Chennai
Android Training in Chennai |Best Android Training course in Chennai
CCNA Training in Chennai | CCNA Training course in Chennai
MCSE Training in Chennai | MCSE Training course in Chennai
Embedded Systems Training in Chennai |Embedded Systems Training course in Chennai
Matlab Training in Chennai | Matlab Training course in Chennai
C C++ Training in Chennai | C C++ Training course in Chennai
linux Training in Chennai | NO.1 linux Training in Chennai
Unix Training in Chennai | NO.1 Unix Training in Chennai
Sql Training in Chennai | NO.1 Sql Training in Chennai
This software of QuickBooks Payroll Support Phone Number is sold with various versions and sub versions. Online Payroll and Payroll for Desktop is the two major versions and they are further bifurcated into sub versions. Enhanced Payroll
ReplyDeleteQuickBooks Support Number We now have trained staff to soft your issue. Sometimes errors may possibly also happen as a consequence of some small mistakes.
ReplyDeleteIt Provides Necessary Features In Real Time For The Enterprises. Since The Software Runs On Desktop And Laptop Devices, It Truly Is Prone To Get Errors And Technical Glitches. But also for Such Cases, QuickBooks Enterprise Techical Support Number Is Present Which Enables A Person To Acquire His Errors Fixed.
ReplyDeleteQuickBooks has been recognised world wide as the utmost effective and useful accounting software. QuickBooks Tech Support Number executives that really work with you on QuickBooks Support contact number are responsible to manage every Quickbook technical issue that produces in QuickBooks software.
ReplyDeleteWe provide Quickbooks Payroll tech support team in terms of customers who find QuickBooks Payroll hard to use. As QuickBooks Online Payroll Contact Number we make use of the responsibility of resolving all of the issues that hinder the performance regarding the exuberant software.
ReplyDeleteA tiny grouping of execs are capable of you manually due to they’re absolute to offer the standard services. So, in the event that you face any issue and your package you don’t need to go anywhere except us. You simply need certainly to build a straightforward charge less call on our QuickBooks Support Phone Number variety and rest leave on united states of america country.
ReplyDeleteQuickBooks Enterprise offers useful features making it more reliable along with efficient. You are able to run your business smoothly with great ease and flexibility by using this specialized accounting software. This is one way you can save your precious time & money using intuit enterprise support. If you are a QuickBooks user and facing any issue regarding this software then call on the QuickBooks Enterprise Tech Support Number.
ReplyDeleteThey move heaven and earth to provide you with the most effective solution they can. QuickBooks Enterprise Support Number customer service executives have a great deal of experience and they are sharp along side smart to find out the particular cause and optimal solution of each error that you may face.
ReplyDeleteOur dedicated team is sure to you. They have been surely working at any hour to aid and make suggestions in the event that you run into any QuickBooks Tech Support Phone Number error/s. Our QuickBooks Support team surely have in-depth knowledge in connection with issues and problems of QuickBooks.
ReplyDeleteQuickBooks Tech Support Number toll free Number advisors are certified Pro-advisors’ and it has forte in furnishing any kind of technical issues for QuickBooks. These are typically expert and certified technicians of their domains like QuickBooks accounting,QuickBooks Payroll, Point of Sales, QuickBooks Merchant Services and Inventory issues to provide 24/7 service to your esteemed customers. QuickBooks payroll Services provide approaches to all your valuable QuickBooks problem and in addition assists in identifying the errors with QuickBooks data files and diagnose them thoroughly before resolving these issues.
ReplyDeleteThe support specialist will identify the difficulty. The deep real cause is likely to be found out. All the clients are extremely satisfied with us. We have many businessmen who burn off our QuickBooks Support Phone Number service. It is simple to come and discover the best service to meet your needs.
ReplyDeleteThe technical Quickbooks Support Number teams who work night and day to eliminate QuickBooks related queries are trained to tune in to the errors, bugs, and glitches that are reported by a user and then derive possible approaches to clear them.
ReplyDeleteSupport For QuickBooks software is helpful for managing the work flow flawless and smooth by prints the payroll components and exchange report are necessary for the modern bookkeepers etc. It is according to application or the cloud based service. Its versions such as:, Payroll, Contractor , Enterprises and Pro Advisor which helps the countless small company world wide .
ReplyDeleteThe most common errors faced by the QuickBooks users is unknown errors thrown by QuickBooks software at the time of software update. To help you to correct the problem, you need to look at your internet and firewall setting, internet browser setting and system time and date setting you can simply contact us at QuickBooks Tech Support Phone Number for instant assistance in QB issues.
ReplyDeleteQuickBooks is rated business accounting software plus the minute query or issue troubling you don't panic, call the QuicKbooks Customer Support Number. The Intuit certified technician called Proadviors will help & help you to sort out any errors , problem .
ReplyDeleteIt is terribly frustrating, to say the smallest amount once you face one particular error. Errors hamper the work pace however additionally disturb your mental peace. Our QuickBooks Support Phone Number take all the errors terribly seriously and that they will fix all of the errors.
ReplyDeleteWe suggest you to definitely join our services just giving ring at toll-free QuickBooks Enterprise Support Phone Number make it possible for you to fix registration, installation, import expert and lots of other related issues into the enterprise version.
ReplyDeleteOur QuickBooks Technical Support is obtainable for 24*7: Call @ QuickBooks Technical Support contact number any time Take delight in with an array of outshined customer service services for QuickBooks via quickbooks technical support contact number at any time and from anywhere. It signifies that one can access our tech support for QuickBooks at any moment. Our backing team is dedicated enough to bestow you with end-to-end QuickBooks solutions when you desire to procure them for every single QuickBooks Support Phone Number.
ReplyDeleteLive Chat support: In the event that customer goes to the QuickBooks Support Phone Number site, there was a live chat feature, which may be helpful as he needs immediate answers to questions.
ReplyDelete
ReplyDeleteQuickBooks Support Phone Number has been developing constructive multiple versions of QuickBooks that shall meet up with your business purpose in one single way or any other. Their widely accessible accounting software versions and packages are unique from 1 another and so they may be chosen based on your online business type and workflow.
Runtime Error 9999 happens when QuickBooks fails or crashes whilst it’s running, hence its name. It doesn’t necessarily mean that the code was corrupt in some way, but just that it did not work during its run-time. If you would like to learn How To Fix Quickbooks Error 9999, you can continue reading this blog.
ReplyDelete"nice blog and very interesting. . .
ReplyDeleteDigital Marketing Training Course in Chennai | Digital Marketing Training Course in Anna Nagar | Digital Marketing Training Course in OMR | Digital Marketing Training Course in Porur | Digital Marketing Training Course in Tambaram | Digital Marketing Training Course in Velachery
"
Trade Stocks, Forex, And Bitcoin Anywhere In The World:exness login Is The Leading Provider Of Software That Allows You To Trade On Your Own Terms. Whether You Are Operating In The Forex, Stock, cgin Software And Anonymous Digital Wallet To Connect With The Financial World.: exness login Is A Currency Trading Company That Allows You To Trade Stocks, Forex, And Cryptocurrency.
ReplyDeletehi thanku so much this infromation thanku so much
ReplyDeletecs executive
freecseetvideolectures/
Nice Topics.. Read My Review Of An Online Cfd Trading Broker,FBS With A Focus On Their Platform And Customer Support Services. I Have Been Using Them For Over A Year And This Is My Honest, Unbiased Review.
ReplyDeleteVery informative blog . But i also want the world to know There is one company in my mind, its name is AFM Logistics pvt Ltd .It gives best quality logistics service ,ie is AFM Logistics Pvt Ltd is an international freight forwarding and customs clearing company established in Delhi. The company was constituted in 2012 and is indulged in providing complete logistics solution. The company has its own setup and wide network of agents throughout the world. International Logistics Companies In India . They are the best air cargo and ocean freight forwarding company in Delhi, India. AFM Logistics Pvt Ltd has been working as Import and Export Agent in India since 2012. They have been providing personal baggage shipping services in India for a very long time.
ReplyDelete9050025388