The document provides an overview of programming with the iPhone SDK, describing the iPhone's features and limitations, the components of the SDK including Xcode, Interface Builder and frameworks, and how to develop applications using Objective-C including defining classes, methods, properties and protocols. It also includes examples of creating a simple Fraction class to demonstrate Objective-C concepts.
This paper presents a personalization platform to adapt Java based applications to Host
Environment; this is to converge the performance and reliability toward platform dependant (e.g.,
like C++). Intelligent Java agent is designed to perceive Host Environment and embed Java Native
Interfaces (JNI) to Java program at Byte Code level. Intelligent Java agent scans host machines for
low level libraries; which are normally DLL (Dynamic Link Library) files, and list them in table.
The personalized program is executed at two performance levels, first level is the impersonalized
level (i.e., not handled by the agent) which is low performance and the second is the personalized
level which is the high level in term of performance due to injecting JNI interfaces
iOS von Apple hat sich inzwischen schon zu einem ausgereiften mobilen Betriebssystem entwickelt. Trotzdem darf Apple auch hier nicht stehen bleiben. Diese Session gibt einen Einblick über den aktuellen Stand von iOS und zeigt die wichtigsten Konzepte. OPITZ CONSULTING Solution Architect Stefan Scheidt präsentierte diesen Vortrag im Rahmen der Mobile DevCon am 19.10.2011 in Hamburg.
A 60-minute webinar on How Hosted Email Archiving Can Save You Money.
View this presentation for an in-depth look at hosted email archiving and discover how much money you can save with software-as-a-service (SaaS) solutions - during a recession or any economic climate.
You'll learn how SaaS email archiving can help you:
- Save more money and time - both upfront as well as on an ongoing basis
- Get more value - in terms of storage, disaster recovery and environmental friendliness
- Worry less - in terms of deployment time, infrastructure and security/compliance
This paper presents a personalization platform to adapt Java based applications to Host
Environment; this is to converge the performance and reliability toward platform dependant (e.g.,
like C++). Intelligent Java agent is designed to perceive Host Environment and embed Java Native
Interfaces (JNI) to Java program at Byte Code level. Intelligent Java agent scans host machines for
low level libraries; which are normally DLL (Dynamic Link Library) files, and list them in table.
The personalized program is executed at two performance levels, first level is the impersonalized
level (i.e., not handled by the agent) which is low performance and the second is the personalized
level which is the high level in term of performance due to injecting JNI interfaces
iOS von Apple hat sich inzwischen schon zu einem ausgereiften mobilen Betriebssystem entwickelt. Trotzdem darf Apple auch hier nicht stehen bleiben. Diese Session gibt einen Einblick über den aktuellen Stand von iOS und zeigt die wichtigsten Konzepte. OPITZ CONSULTING Solution Architect Stefan Scheidt präsentierte diesen Vortrag im Rahmen der Mobile DevCon am 19.10.2011 in Hamburg.
A 60-minute webinar on How Hosted Email Archiving Can Save You Money.
View this presentation for an in-depth look at hosted email archiving and discover how much money you can save with software-as-a-service (SaaS) solutions - during a recession or any economic climate.
You'll learn how SaaS email archiving can help you:
- Save more money and time - both upfront as well as on an ongoing basis
- Get more value - in terms of storage, disaster recovery and environmental friendliness
- Worry less - in terms of deployment time, infrastructure and security/compliance
Using XCode 3.0 under Mac OS X 10.5 as our IDE, and Objective-C and iPhone API as our programming tools we will create iPhone applications (from basic to medium level), which finally can be, load into an iPhone. We’ll start with the classical “Hello World” and continue to develop applications using graphical user interfaces, handling multi-touch and detect motion, communication
with web application, and different media.
iOS Development - Offline Class for JasakomerAndri Yadi
A slide I presented yesterday on Offline Class of Jasakom - one of a biggest hacker community in Indonesia.
This slide is quite similar with my previous slides of the same topic, but with more and updated content.
Cara Tepat Menjadi iOS Developer Expert - Gilang RamadhanDicodingEvent
Untuk memenangkan kompetisi pasar dan mengatasi mahalnya biaya akuisisi pengguna, diperlukan aplikasi iOS dengan performa tinggi yang siap saing dan pro pada retensi pengguna.
Seorang iOS Developer Expert adalah sosok yang mampu mewujudkan App paripurna tersebut. Minim bug, tinggi level keamanannya, dan kecilnya ukuran aplikasi adalah faktor yang harus ia pertimbangkan demi kenyamanan pengguna.
Sementara itu dari sisi kode, seorang iOS Developer Expert harus memastikan bahwa aplikasinya scalable alias tetap bekerja dengan baik saat produk berubah mengikuti kebutuhan bisnis. App tersebut juga harus robust alias dibangun dengan pondasi kode yang kuat.
Jika tidak, perusahaan akan terbebani biaya pengembangan yang tinggi karena sulitnya perbaikan akibat code smell, yakni kode yang berantakan atau berstruktur buruk.
Dalam IDCamp x Dicoding LIVE kali ini kita akan membahas hal-hal yang mesti seorang iOS Developer Expert pahami, yakni best-practice penerapan teknologi terbaru iOS Development yang industri perlukan, sesuai dengan kebutuhan bisnis.
Jika impianmu adalah menjadi iOS Developer Expert, kamu memerlukan insight ini agar kode menjadi lebih kokoh dan mudah untuk dikembangkan menyesuaikan dengan kebutuhan bisnis.
Poin-poin yang akan dibahas mencakup:
- Apa saja praktik terbaik dan keahlian yang wajib kamu miliki guna menjadi iOS Developer Expert? Kenapa penting?
- Bagaimana kelas Menjadi iOS Developer Expert di Dicoding dapat bantu kamu menjadi iOS Developer Expert?
Here are some of the most important iOS development tools used by a professional iPhone app development company in India to create its own applications. This technology enables highly flexible, secure, and efficient iPhone app development with stunning UI/UX styles that are certified and released on the Apple Store in a single step. Powerful iOS applications are built with the best tools iOS application development companies in Bangalore know.
Arcadian Learning is an Industrial Training Company with 50 years of Industry Expertise on Planning, Implementation and Operation of the Networks Offering six months Industrial Training program on Cloud Computing, Telecom, Big Data and Application Development.
Experience iOS application development using the iOS SDK and Cocoa, Objective-C and Xcode Knowledge of Object Oriented concepts and a strong passion for software development towards the app
development.
http://www.arcadianlearning.com/application-web-development.html
Greens Technology is a leading Training and Placement company in Chennai. We are
known for our practical approach towards trainings that enable students to gain real-
time exposure on competitive technologies. Trainings are offered by employees from
MNCs to give a real corporate exposure.
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
UiPath Test Automation using UiPath Test Suite series, part 5DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 5. In this session, we will cover CI/CD with devops.
Topics covered:
CI/CD with in UiPath
End-to-end overview of CI/CD pipeline with Azure devops
Speaker:
Lyndsey Byblow, Test Suite Sales Engineer @ UiPath, Inc.
Dr. Sean Tan, Head of Data Science, Changi Airport Group
Discover how Changi Airport Group (CAG) leverages graph technologies and generative AI to revolutionize their search capabilities. This session delves into the unique search needs of CAG’s diverse passengers and customers, showcasing how graph data structures enhance the accuracy and relevance of AI-generated search results, mitigating the risk of “hallucinations” and improving the overall customer journey.
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
200910 - iPhone at OOPSLA
1. Programming with iPhone SDK
Javier González Sánchez
Maria Elena Chávez Echeagaray
Copyright is held by the author/owner(s).
OOPSLA 2009, October 25–29, 2009, Orlando, Florida, USA.
4. What is iPhone ?
Limited screen size. You have a 480 x 320
pixels screen.
Light mobile. Height: 4.5 inches, Width: 2.4
inches, Depth 0.48 inches, Weight: 4.8
ounces.
One application at a time. It only can
handle one application running at a time.
Only one window. iPhone applications only
can have one window at a time.
Five seconds limit. When the user hits the
home button, your application will have 5
seconds to save data, close and give up its
control. If it takes more than that, it will be
terminated.
4
5. What is iPhone ?
CPU. 412 | 600 MHz
Memory administration. It has 128 | 256
MB of physical RAM and 8 | 32 GB of
storage.
File Management. It provides each
application with a sandbox (2GB), where the
application can read/write files, store
documents, preferences and data.
Different physical interface. iPhone do not
have a physical keyboard and a mouse.
Instead of that we have multitouch.
Other features. iPhone includes Core
Location, 3 megapixels built-in camera and
photo library, a built-in accelerometer,
proximity sensor, and ambient light sensor.
And a Phone with WiFi
Memory management without a “garbage
collector”. 5
8. How does this works?
There is a free SDK that allow you to create your applications, and test them
in a Simulator.
Ok!, so what?, Is this a business?
There is a Standard or the Enterprise version of the SDK. They cost $99 and
$299 respectively.
Now you can upload your application to your iPhone or distribute them in
Apples’ iPhone App Store.
They take care of the process, you then take care or your development.
8
12. Tools
We are going to be working with:
Xcode. Apple's Integrated Development Environment (IDE).
Interface Builder (IB). environment to facilitate the development of your GUI's
and to give functionality to its components.
iPhone Simulator. It allows you to run your iPhone programs on your Mac.
NOTE: the free SDK does not allow you to upload your applications to your
iPhone (or iPod Touch) or distribute your software in Apples' iPhone App Store. In
order to do this, you have to get the Standard ($99) or the Enterprise ($299)
version of the SDK.
Instruments. environment It lets you analyze the performance of your iPhone
applications while running in the simulator or on a device.
12
14. Interface Builder
Library
View
.xib file
View
Instance of UIView, this is
the area the users interact Design area
GUI elements with 14
15. Interface Builder
Interface Builder is the tool you use to assemble your application’s user interface
visually.
You assemble your application’s window by dragging and dropping preconfigured
components onto it.
The components include standard system controls such as switches, text fields, and buttons,
and also custom views to represent the views your application provides.
After you’ve placed the components on the window’s surface, you can establish the
relationships between those objects and your code. When your interface looks the way you
want it, you save the contents to a nib file, which is a custom resource file format.
The nib files you create in Interface Builder contain all the information that the UI Kit
needs to recreate the same objects in your application at runtime. Loading a nib file
creates runtime versions of all the objects stored in the file, configuring them exactly
as they were in Interface Builder.
15
19. Objective-C
Is a simple computer language designed to enable sophisticated OO programming.
Extends the standard ANSI C language by providing syntax for defining classes,
methods, and properties, as well as other constructs that promote dynamic
extension of classes.
Based mostly on Smalltalk (class syntax and design), one of the first object-oriented
programming languages.
Includes the traditional object-oriented concepts, such as encapsulation,
inheritance, and polymorphism.
19
20. Files
Extension Source Type
.h Header files. Header files contain class, type, function, and
constant declarations.
.m Source files. This is the typical extension used for source
files and can contain both Objective-C and C code.
.mm Source files. A source file with this extension can contain C+
+ code in addition to Objective-C and C code.
This extension should be used only if you actually refer to C+
+ classes or features from your Objective-C code.
20
21. #import
To include header files in your source code, you can use the standard #include, but….
Objective-C provides a better way #import. it makes sure that the same file is never
included more than once.
#import
“MyAppDelegate.h”
#import
“MyViewController.h”
#import
<UIKit/UIKit.h>
21
22. Class
The specification of a class in Objective-C requires two distinct pieces: the
interface (.h files) and the implementation (.m files).
The interface portion contains the class declaration and defines the instance
variables and methods associated with the class.
@interface
…
@end
The implementation portion contains the actual code for the methods of the
class.
@implementation
…
@end
22
23. Class
Class name
@interface
MyClass
:
NSObject
Parent class
{
int
count;
id
data;
Instance variables
NSString*
name;
}
-‐
(id)initWithString:(NSString
*)aName;
methods
+
(MyClass
*)createMyClassWithString:
(NSString
*)
aName;
@end
23
24. Class
Class name
@implementation
MyClass
-‐
(id)initWithString:(NSString
*)
aName
{
if
(self
=
[super
init])
{
count
=
0;
data
=
nil;
methods
name
=
[aName
copy];
return
self;
}
}
+
(MyClass
*)createMyClassWithString:
(NSString
*)
aName
{
return
[[[self
alloc]
initWithString:aName]
autorelease];
}
@end
24
25. Methods
A class in Objective-C can declare two types of methods:
Instance method is a method whose execution is scoped to a particular instance of the
class. In other words, before you call an instance method, you must first create an
instance of the class.
Class methods, by comparison, do not require you to create an instance.
Method type identifier One or more signature keywords
-‐(void)insertObject:(id)anObject
atIndex:(NSUInteger)index;
Return type Parameters with (type) and name
25
26. Methods
So
the
declaration
of
the
method
insertObject
would
be:
-‐(void)insertObject:(id)anObject
atIndex:(NSUInteger)index
Method type identifier, is (-) to instance methods, (+) to class methods.
And
the
line
to
call
the
method
would
be:
[myArray
insertObject:anObj
atIndex:0];
26
27. Properties
They are simply a shorthand for defining methods (getters and setters) that
access existing instance variables.
Properties do not create new instance variables in your class declaration.
Reduce the amount of redundant code you have to write. Because most
accessor methods are implemented in similar ways
You specify the behavior you want using the property declaration and then
synthesize actual getter and setter methods based on that declaration at
compile time.
27
28. Properties
In the interface we have:
{
BOOL
flag;
NSString*
myObject;
UIView*
rootView;
}
@property
BOOL
flag;
@property
(copy)
NSString*
myObject;
//
Copy
the
object
during
assignement
@property
(readonly)
UIView*
rootView;
//
Create
only
a
getter
method.
…
And in the implementation side we have:
@syntetize
flag;
@syntetize
myObject;
@syntetize
rootView;
…
myObject.flag
=
YES;
CGRect
viewFrame
=
myObject.rootView.frame;
28
29. Properties
Writability
Readwrite. You can read/write it. This is the default value.
Readonly. You can only read it.
Setter semantics (mutually exclusive)
Assign. Specifies that the setter uses simple assignment. This is the default value.
Retain. Specifies that a pointer should be retained.
Copy. Specifies that a copy of the object should be used for assignment.
Atomicity (multithreading)
Nonatomic. Specifies that accessor methods are not atomic.
The default value is atomic but there is no need to specify it.
29
30. Protocols and Delegates
Protocols are not classes themselves. They simply define an interface that other objects
are responsible for implementing
A protocol declares methods that can be implemented by any class.
In iPhone OS, protocols are used frequently to implement delegate objects. A delegate
object is an object that acts on behalf of, or in coordination with, another object.
The declaration of a protocol looks similar to that of a class interface, with the exceptions
that protocols do not have a parent class and they do not define instance variables.
In the case of many delegate protocols, adopting a protocol is simply a matter of
implementing the methods defined by that protocol. There are some protocols that
require you to state explicitly that you support the protocol, and protocols can specify
both required and optional methods.
30
31. Example: Fraction
Fraction.h
Fraction.m
#import
<Foundation/NSObject.h>
#import
"Fraction.h"
#import
<stdio.h>
@interface
Fraction:
NSObject
{
int
numerator;
@implementation
Fraction
int
denominator;
}
@synthesize
numerator;
//Properties
instead
of
getters
and
@synthesize
denominator;
//setters
@property
(nonatomic)
int
numerator;
//
Output
Print
@property
(nonatomic)
int
denominator;
-‐(void)
print
{
printf("%i/%i",
numerator,denominator);
}
//Output
print
@end
-‐(void)
print;
@end
31
32. Example: Fraction
main.m
#import <stdio.h>
#import "Fraction.h"
int main( int argc, const char *argv[] ) {
Fraction *frac = [[Fraction alloc] init];
frac.numerator = 1;
frac.denominator=3;
printf( "The fraction is: " );
[frac print];
printf( "n" );
[frac release]
return 0;
}
32
33. Strings
The NSString class provides an object wrapper.
Supports storing arbitrary-length strings, support for Unicode, printf-style
formatting utilities, and more.
Shorthand notation for creating NSString objects from constant values.
Precede a normal, double-quoted string with the @ symbol.
NSString*
myString
=
@”Hello
Worldn";
NSString*
anotherString
=
[NSString
stringWithFormat:@"%d
%s",
1,
@"String”];
33
40. View (go back to IB)
View
Include
XIB files
IBOutlet
IBAction
Protocol
implementation
Model Controller
Delegates
UIApplicationDelegate
UIAccelerometerDelegate
UILocationManagerDelegate
40
41. Controller
View
Include
XIB files
IBOutlet
IBAction
Protocol
implementation
Model Controller
Delegates
UIApplicationDelegate
UIAccelerometerDelegate
UILocationManagerDelegate
41
42. Actions and Outlets
Outlet: is a pointer that points an
object in the NIB file.
• Action: objects in the nib can trigger
special methods in our controller. These
special methods are known as action
methods.
42
45. Connecting
We need to connect the elements in the interface with its functionality, i.e., we have
to connect our View with the File's Owner.
With this connection we are telling our controller that when our application starts it
loads the TutorialEvaluationViewController.xib file into memory and get control of it.
UI
45
49. Handling Touch Events
All UIViewController inherit from UIResponder, and is able to handle touch Event.
In order to do this we use these three methods.
-‐
(void)touchesBegan:(NSSet
*)touches
withEvent:(UIEvent
*)event;
-‐
(void)touchesMoved:(NSSet
*)touches
withEvent:(UIEvent
*)event;
-‐
(void)touchesEnded:(NSSet
*)touches
withEvent:(UIEvent
*)event;
49
54. AutoRotate
The UIViewController class provides the infrastructure needed to rotate your interface and
adjust the position of views automatically in response to orientation changes.
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation interfaceOrientation {
return YES;
//return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
interfaceOrientation values:
UIInterfaceOrientationPortrait
UIInterfaceOrientationPortraitUpsideDown
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
54
57. Reading the Accelerometer
UIAccelerometer object in UIKit allow you to access to the raw accelerometer
data directly. This object reports the current accelerometer values.
To get an instance of this class, call the sharedAccelerometer method of
UIAccelerometer class.
The updateInterval property define the reporting interval in seconds.
-‐(void)viewDidLoad
{
UIAccelerometer
*accelerometer
=
[UIAccelerometer
sharedAccelerometer];
accelerometer.delegate
=
self;
accelerometer.updateInterval
=
1.0/60;
[super
viewDidLoad];
}
57
58. Reading the Accelerometer
A delegate (UIAccelerometerDelegate) will receive acceleration events.
@interface
FooViewController:
UIViewController
<UIAccelerometerDelegate>
Use accelerometer:didAccelerate: method to process accelerometer data.
-‐(void)accelerometer:(UIAccelerometer
*)accelerometer
didAccelerate:
(UIAcceleration
*)acceleration
{
NSString
*s
=
[[NSString
alloc]
initWithFormat:@"%f,
%f,
%f",
acceleration.x,
acceleration.y,
acceleration.z];
accLabel.text
=
s;
[s
release];
}
58
62. Core Location
The Core Location framework monitors signals coming from cell phone towers
and Wi-Fi hotspots and uses them to triangulate the user's current position.
62
63. Getting the User's Current Location
Create an instance of CLLocationManager class.
It
is
necessary
to
include
the
CoreLocation.framework
#import
<CoreLocation/CoreLocation.h>
@interface
FooViewController:
UIViewController<CLLocationManagerDelegate>
To begin receiving notifications, assign a delegate and call the
startUpdatingLocation method.
-‐(void)viewDidLoad
{
CLLocationManager
*locationManager=
[[CLLocationManager
alloc]
init];
[locationManager
startUpdatingLocation];locationManager.delegate
=
self;
locationManager.distanceFilter
=
kCLDistanceFilterNone;
locationManager.desiredAccuracy
=
kCLLocationAccuracyBest;
}
63
81. Instructors
Javier González Sánchez
Tecnológico de Monterrey, campus Guadalajara
javiergs@itesm.mx
.com/in/javiergs
Maria Elena Chávez Echeagaray
Tecnológico de Monterrey, campus Guadalajara
mechavez@itesm.mx
.com/in/mechavez
81