Application Resource Constraints
As with the HD displays on our desktops and laptops, we’ve grown accustomed to
processors that can work faster than we can click. The iPhone uses a ~400MHz ARM
in the early models, a ~600MHz version in the 3GS, and a 1GHz A4 in the iPhone 4.
The A4 is a “system on a chip” that provides CPU, GPU, and other capabilities to the
device and is the first Apple-designed CPU to be used in quite a while.
Apple has gone to great lengths to keep the iPhone responsive regardless of what
you’re doing. Unfortunately, that means that unlike the Mac OS, your iPhone’s
capability to multitask is limited. In iOS 4, Apple has created a limited set of multitasking
APIs for very specific situations. These enable you to perform some tasks in
the background, but your application can never assume that it will remain running.
The iOS preserves the user experience beyond above all else.
Another constraint that you need to be mindful of is the available memory. In the
original and iPhone 3G devices, 128MB of RAM is available for the entire system,
including your application. There is no virtual memory, so you must carefully manage
the objects that your application creates. In the iPhone 3GS Apple upped the ante to
256MB and, with the iPhone 4, Apple has graciously provided 512MB! This is great
for us, but keep in mind that there are no RAM upgrades for earlier models!
ข้อ จำกัด ทรัพยากรการประยุกต์ใช้
เช่นเดียวกับการแสดง HD บนเดสก์ท็และแล็ปท็อปของเราเราได้เติบโตคุ้นเคยกับการ
ประมวลผลที่สามารถทำงานได้เร็วกว่าที่เราสามารถคลิกที่ iPhone ใช้ ~ 400MHz ARM
ในรุ่นแรก, รุ่น ~ 600MHz ใน 3GS และ 1GHz A4 ใน iPhone 4
A4 คือ "ระบบบนชิป" ที่ให้ CPU, GPU และความสามารถอื่น ๆ
อุปกรณ์และ CPU แอปเปิ้ลได้รับการออกแบบครั้งแรกที่จะถูกนำมาใช้ในขณะที่ค่อนข้าง
แอปเปิ้ลได้ไปช่วงที่ดีที่จะทำให้ iPhone ตอบสนองโดยไม่คำนึงถึงสิ่งที่
คุณกำลังทำ แต่น่าเสียดายที่ว่าหมายความว่าแตกต่างจาก Mac OS, iPhone ของคุณ
ความสามารถในการทำงานหลายที่มี จำกัด ใน iOS 4, แอปเปิ้ลได้สร้างชุด จำกัด ของการทำงานหลาย
APIs สำหรับสถานการณ์ที่เฉพาะเจาะจงมาก เหล่านี้ช่วยให้คุณสามารถดำเนินการบางอย่างใน
พื้นหลัง แต่ใบสมัครของคุณไม่สามารถคิดว่ามันจะยังคงทำงาน
iOS รักษาประสบการณ์การใช้งานเกินกว่าเหนือสิ่งอื่นใด
ข้อ จำกัด ที่คุณจะต้องระวังก็คือหน่วยความจำที่มีอยู่ ใน
ต้นฉบับและอุปกรณ์ iPhone 3G, 128MB RAM ที่พร้อมใช้งานสำหรับระบบทั้งหมด
รวมทั้งใบสมัครของคุณ ไม่มีหน่วยความจำเสมือนเป็นดังนั้นคุณจะต้องระมัดระวังในการจัดการ
วัตถุว่าโปรแกรมที่คุณสร้าง ในแอปเปิ้ล iPhone 3GS upped ante เพื่อ
256MB และกับ iPhone 4, แอปเปิ้ลได้ให้เกล้าฯ 512MB! นี่คือที่ดี
สำหรับเรา แต่เก็บไว้ในใจว่าไม่มีการอัพเกรดแรมสำหรับรุ่นก่อนหน้านี้!
การแปล กรุณารอสักครู่..
