Monday, August 3, 2009

Map View in iPhone

#import "MatchProfile_MapController.h"
#import "POL.h"

@implementation MatchProfile_MapController
@synthesize intTag1;

- (void)viewDidLoad {

self.navigationItem.title=@"Select Person";
appdelegate=[[UIApplication sharedApplication]delegate];

for(int i=0;i<[appdelegate.arrayRecentCompatible count];i++)
{
NSMutableDictionary *dic=[appdelegate.arrayRecentCompatible objectAtIndex:i];

CLLocationCoordinate2D coord;
coord.latitude =[[dic valueForKey:@"Latitude"] doubleValue];
coord.longitude =[[dic valueForKey:@"Longitude"] doubleValue];

POL *poi = [[POL alloc] initWithCoords:coord];
poi.title =[dic valueForKey:@"Name"];
poi.subtitle =[dic valueForKey:@"Country"];
poi.img1=[UIImage imageNamed:[dic valueForKey:@"Image"]];
poi.intTag=i;
[mapView addAnnotation:poi];
}

mapView.delegate=self;

MKCoordinateRegion zoomIn = mapView.region;
zoomIn.span.latitudeDelta *=5;
[mapView setRegion:zoomIn animated:YES];
[super viewDidLoad];
}
- (MKAnnotationView *) mapView:mapView viewForAnnotation:(id ) annotation
{

newAnnotation = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@""];
[newAnnotation setPinColor:MKPinAnnotationColorGreen];
newAnnotation.animatesDrop = YES;
newAnnotation.canShowCallout = YES;
POL *TempPOL=(POL*) annotation;

UIButton *btnRow1=[[UIButton buttonWithType:UIButtonTypeCustom]retain];
btnRow1.frame=CGRectMake(0, 0, 25, 30);
[btnRow1 setBackgroundImage:TempPOL.img1 forState:UIControlStateNormal];
[btnRow1 addTarget:self action:@selector(selectUSer:) forControlEvents:UIControlEventTouchUpInside];
btnRow1.tag=TempPOL.intTag;
newAnnotation.leftCalloutAccessoryView=btnRow1;

UIButton *btnRow2=[[UIButton buttonWithType:UIButtonTypeDetailDisclosure]retain];
[btnRow2 addTarget:self action:@selector(selectUSer:) forControlEvents:UIControlEventTouchUpInside];
btnRow2.tag=TempPOL.intTag;
newAnnotation.rightCalloutAccessoryView=btnRow2;
return newAnnotation;
}

#pragma mark -
#pragma mark Memory methods

- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}

- (void)viewDidUnload {
}

- (void)dealloc {
[super dealloc];
}


#pragma mark -
#pragma mark Methods

-(IBAction)selectUSer:(id)sender
{
if(objProfile==nil)
objProfile=[[ProfileViewController alloc]initWithNibName:@"ProfileViewController" bundle:nil];

for(int i=0;i<4;i++)
{
NSMutableDictionary *dic=[appdelegate.arrayRecentCompatible objectAtIndex:i];

UIButton *btn=(UIButton*)sender;

if(btn.tag==i)
{
objProfile.intPerson=i;
objProfile.strTitle=[dic valueForKey:@"Name"];
}
}

[self.navigationController pushViewController:objProfile animated:YES];
}

@end

364 days left to launch iPhone 4G

Now that the iPhone 3G S is officially behind us, let me be the first--or at least one of the first--to announce the countdown to the next new iPhone. If history is any indication, it should show up right around this time next year.Interestingly, even though the 3G S is technically Apple's third-generation iPhone, some tech pundits were expecting the iPhone 3G S to be called the iPhone 4G. But you could also argue that the iPhone 3G S is more like the iPhone 3.5G, which doesn't have the greatest ring.There's also a chance that in between the iPhone 3G S and iPhone 4G (or whatever it's called), we might see a totally new branch of iPhone, something akin to an iPhone Mini or Lite.I'm not sure Apple needs to answer to the smaller form factor of the Palm Pre, but there are some people out there who think the iPhone's just a tad too big. And there are some people who want a physical keyboard, but don't count on Apple slipping in a slide-out keyboard anytime soon.

All that said, I do think next year's iPhone will feature a new design that also includes a new screen. Some mock-ups floating around have suggested the aluminum unibody design of the new MacBooks. That's possible, but so are a host of other innovative industrial designs.
The point is, the next go-round, it's probably not enough to just stick with upgraded internal components. Some significant cosmetic changes will be required to differentiate the generations and more easily entice upgrades by existing iPod owners. And I'm not talking matte vs. shiny finish.Ultimately, however, it's what's inside that counts and consumers are always wanting faster, more powerful smartphones with more memory that somehow manage to be more energy-efficient and offer better battery life. There's already talk of the next iPhone having a dual-core processor and better graphics chips that can deliver higher video resolutions and better still images when taking pictures (read Brooke Crothers' story on new ARM chips here).The question is whether Apple can continue to increase battery life at the same time. In fact, one big reason a lot of people are interested in upgrading from the 3G to the 3G S is because of the improved battery life.Beyond the hardware, there are still features concerns to address (everybody has their wishlist) and more importantly, carrier and pricing plan issues. Someday, some other carrier, perhaps Verizon, which is preparing to build out a 4G network, will get the iPhone. And someone, maybe Apple, will declare that iPhone the iPhone 4G. Or maybe it'll just be the 3G V. All I know is that come this time next year, we'll most likely be seeing a new iPhone. And it will be here before you know it.

Comments? Aside from a carrier choice, what are looking for in a true 4G iPhone?

Finding and Viewing Locations

For important information about driving and navigating safely, see the Important Product Information Guide.Maps provides street maps, satellite photos, a hybrid view, and street views of locations in many of the world’s countries. You can get detailed driving, public transit, or walking directions and traffic information. Find and track your current (approximate) location, and use your current location to get driving directions to or from another place. The built-in digital compass lets you see which way you’re facing. (iPhone 3GS only).

Note: Maps, digital compass (iPhone 3GS only), directions, and location-based applications provided by Apple depend on data collected and services provided by third parties. These data services are subject to change and may not be available in all geographic areas, resulting in maps, compass headings, directions, or location-based information that may be unavailable, inaccurate, or incomplete. Compare the information provided on iPhone to your surroundings and defer to posted signs to resolve any discrepancies. In order to provide your location, data is collected in a form that doesn’t personally identify you. If you don’t want such data collected, don’t use the feature. Not using this feature won’t impact the non–location-based functionality of your iPhone.

Find a location and see a map:

1. Tap the search field to bring up the keyboard.

2. Type an address, intersection, area, landmark, bookmark, contact, or zip code.

3. Tap Search.