2015-06-18 10:07:47 conslee 阅读数 2188

上海iOS开发工资待遇如何呢?一般来说,上海iOS开发的工资还算相对不错的,毕竟是一线城市的魔都,整体来说还算可以。


上海iOS开发起步薪资大概在5k~8k吧,如果你技术好,在大学里面就是学霸,对计算机也非常精通,超过8k,也不是完全没有可能的。5k~8k只是一个参考值,主要还是靠自己。


对于工作一两年的上海iOS开发者朋友们来说,工资应该在8k~15k。也就是说,上海iOS开发者有一两年工作经验,工资很轻松过五位数。


做一位一名程序员,工作过五位数很正常,尤其是上海iOS开发程序员。


当你在上海做iOS开发三四年以上,而且你的技术确实有牛C,这个时候,工资完全可以突破2万。2万对于程序员来说是一个重要的标志,上海iOS开发程序员也不例外。2万说明你应该是一名很不错的程序员了。


以上是上海iOS开发工资的一个参考,具体可以根据实际面试情况来谈你的工资。


上海iOS开发需求量也很大,所以对于想进入iOS开发行业的人来说,上海iOS开发职位是一个很不错的选择。


2016-09-30 15:57:39 huanghaiyan_123 阅读数 1544

实现思路:

  1. 首先我们需要城市数据资源,这里存到了plist文件里。
  2. 从plist里面取出城市数据,自己实现index索引列表。
  3. 代理方法传值,将列表页选中的数据传到上一页面。

plist文件格式如下图:
city

代码示范:

HYCityViewController.h文件

//  HYCityViewController.h
#import <UIKit/UIKit.h>
//代理声明
@protocol HYCityViewDelegate <NSObject>

- (void)sendCityName:(NSString *)name;

@end

@interface HYCityViewController : UIViewController

@property (nonatomic,weak)id <HYCityViewDelegate> delegate;

@end

HYCityViewController.m文件

#import "HYCityViewController.h"

#define kScreen_width [UIScreen mainScreen].bounds.size.width
#define kScreen_height [UIScreen mainScreen].bounds.size.height

@interface HYCityViewController ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic,strong) UITableView *cityTableView;

/**
 *  当前城市数据源
 */
@property (nonatomic,strong) NSMutableArray *dataSourceArr;

/**
 *  索引数据源
 */
@property (nonatomic,strong) NSMutableArray *indexSourceArr;

@end

@implementation HYCityViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    [self initNav];
    [self initDataSource];
    [self initTableView];
}

- (void)initNav
{
    UIView *bgView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreen_width, 64)];
    bgView.backgroundColor = [UIColor colorWithRed:241/255.0f green:241/255.0f  blue:241/255.0f  alpha:1.0f];
    [self.view addSubview:bgView];

    //取消按钮
    UIButton *closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    closeBtn.frame = CGRectMake(20, 30, 20, 20);
    [closeBtn setImage:[UIImage imageNamed:@"icon_nav_quxiao_normal"] forState:UIControlStateNormal];
    [closeBtn addTarget:self action:@selector(closeBtn:) forControlEvents:UIControlEventTouchUpInside];
    [bgView addSubview:closeBtn];

    //标题
    UILabel *titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(kScreen_width/2-50, 30, 100, 25)];
    titleLabel.textColor = [UIColor blackColor];
    titleLabel.textAlignment = NSTextAlignmentCenter;
    titleLabel.font = [UIFont systemFontOfSize:18];
    titleLabel.text = @"选择城市";
    [bgView addSubview:titleLabel];
}

-(void)initTableView
{
    self.cityTableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 64, kScreen_width, kScreen_height - 64) style:UITableViewStylePlain];
    self.cityTableView.dataSource = self;
    self.cityTableView.delegate = self;
    self.cityTableView.sectionIndexColor = [UIColor colorWithRed:252/255.0f green:74/255.0f blue:132/255.0f alpha:1.0f];
    [self.view addSubview:self.cityTableView];
}

-(void)initDataSource
{
    self.dataSourceArr = [[NSMutableArray alloc]init];
    self.indexSourceArr = [[NSMutableArray alloc]init];

    NSString *plistPath = [[NSBundle mainBundle]pathForResource:@"city" ofType:@"plist"];
    NSMutableArray *cityArr = [[NSMutableArray alloc]initWithContentsOfFile:plistPath];
    _dataSourceArr = [self sortArray:cityArr];
}



- (NSMutableArray *)sortArray:(NSMutableArray *)originalArray
{
    NSMutableArray *array = [[NSMutableArray alloc]init];

    //根据拼音对数组排序
    NSArray *sortDescriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"pinyin" ascending:YES]];
    //排序
    [originalArray sortUsingDescriptors:sortDescriptors];

    NSMutableArray *tempArray = nil;
    BOOL flag = NO;

    //分组
    for (int i = 0;i < originalArray.count; i++) {
        NSString *pinyin = [originalArray[i] objectForKey:@"pinyin"];
        NSString *firstChar = [pinyin substringToIndex:1];
        if (![_indexSourceArr containsObject:[firstChar uppercaseString]]) {
            [_indexSourceArr addObject:[firstChar uppercaseString]];
            tempArray = [[NSMutableArray alloc]init];
            flag = NO;
        }
        if ([_indexSourceArr containsObject:[firstChar uppercaseString]]) {
            [tempArray addObject:originalArray[i]];
            if (flag == NO) {
                [array addObject:tempArray];
                flag = YES;
            }
        }
    }
    return array;
}

#pragma mark dataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return self.dataSourceArr.count;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return [self.dataSourceArr[section] count];
}

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
    return [_indexSourceArr objectAtIndex:section];
}

- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
{
    return _indexSourceArr;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 50;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *cellIndentifier = @"cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIndentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIndentifier];
    }
    cell.textLabel.text = [[self.dataSourceArr[indexPath.section] objectAtIndex:indexPath.row] objectForKey:@"name"];
    return cell;
}

#pragma mark - UITableViewDelegate
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{

    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    //代理传值
    if (self.delegate != nil) {
        [self.delegate sendCityName:[[self.dataSourceArr[indexPath.section] objectAtIndex:indexPath.row] objectForKey:@"name"]];
         [self dismissViewControllerAnimated:YES completion:nil];
    }
}

- (void)closeBtn:(UIButton *)sender
{
    [self dismissViewControllerAnimated:YES completion:nil];
}

@end

ViewController.m文件

#import "ViewController.h"
#import "HYCityViewController.h"
@interface ViewController ()<HYCityViewDelegate>

@property (nonatomic,strong) UIBarButtonItem *leftBtn;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    _leftBtn = [[UIBarButtonItem alloc]initWithTitle:@"北京" style:UIBarButtonItemStylePlain target:self action:@selector(selectCity)];
    [_leftBtn setTintColor:[UIColor colorWithRed:252/255.0f green:74/255.0f blue:132/255.0f alpha:1.0f]];
    self.navigationItem.leftBarButtonItem = _leftBtn;

}

- (void)selectCity{
    HYCityViewController *cityVC = [[HYCityViewController alloc]init];
    cityVC.delegate = self;
    [self presentViewController:cityVC animated:YES completion:nil];
}

- (void)sendCityName:(NSString *)name{
    [_leftBtn setTitle:name];
}

效果图:
xiaoguotu

代码地址:https://github.com/huanghaiyan/SelectCity-demo

2018-08-10 20:00:05 weixin_38633659 阅读数 1155

一、简介

该项目集成了三种类型的城市选择器:

  • 1、XXCityPickerView 省市区,可以分级:1省 2省-市 3省-市-区
  • 2、SQSelectAddress 省市区乡/镇,页面跳转
  • 3、RattanCityPicker 省市区,包含邮编地址,开放多个属性设置的接口

二、XXCityPickerView使用

1、从该项目导入【XXCityPickerView】文件包

2、 导入系统库 :libsqlite3.tbd

3、方法实现

#import "XXCityPickerView.h"

@interface ViewController ()<XXCityPickerViewDelegate>

@property(nonatomic,strong)XXCityPickerView *cityPicker;

@end

@implementation ViewController

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

///方法调用
-(void)clickAction{
    [self cityPicker];
}

- (XXCityPickerView *)cityPicker{
    if (_cityPicker == nil){
        // 初始化  设置类别   1省  2省-市  3省-市-区
        _cityPicker = [[XXCityPickerView alloc]initWithComponents:3];
        // 设置代理
        _cityPicker.delegate = self;
        [self.view addSubview:_cityPicker];
    }
    return  _cityPicker;
}   

4、代理实现

// ---- 【XXCityPickerViewDelegate】
// 取消
- (void)XXCityPickerViewLeftAction{
    [self removeCityPickerView];
}
// 完成
- (void)XXCityPickerViewRightAction:(XXCityPickerView *)picker andCity:(NSString *)city andData:(NSMutableDictionary *)dic{
    [self removeCityPickerView];
    NSLog(@"������XXCityPickerView:\n city= %@   dic= %@",city,dic);
}

-(void)removeCityPickerView{
    if (_cityPicker) {
        [_cityPicker removeFromSuperview];
        _cityPicker = nil;
    }
}

三、SQSelectAddress使用

1、导入【SQSelectAddress】文件包

2、调用【SQSelectAddressViewController.h】类

3、协议声明

@interface ViewController ()<SQSelectAddressViewControllerDelegate>

4、方法实现

pragma mark -
#pragma mark - SQSelectAddress
///页面添加
-(void)sqSelectAddressPockerView{
    SQSelectAddressViewController *selectAddressVC = [[SQSelectAddressViewController alloc] init];
    //签署协议
    selectAddressVC.delegate = self;
    selectAddressVC.animating = NO;
    selectAddressVC.footerBg_color = [UIColor greenColor];
    selectAddressVC.headerBg_color = [UIColor greenColor];
    selectAddressVC.title_font = [UIFont systemFontOfSize:25];
    selectAddressVC.titleText_color = [UIColor orangeColor];
    [self presentViewController:selectAddressVC animated:YES completion:nil];
}

5、代理协议实现

- (void)selectAddressViewController:(SQSelectAddressViewController *)selectController selectedDetailAdreess:(NSString *)address townCode:(NSString *)townCode{
    NSLog(@"����SQSelectAddress:\n地址=%@  编码=%@",address,townCode);
}

四、RattanCityPicker使用

1、导入[RattanCityPicker]文件包

2、方法实现

#import "RattanCityPicker.h"

#pragma mark -
#pragma mark - RattanCityPicker

-(void)rattanCity{
    RattanCityPicker *picker=[[RattanCityPicker alloc] init];
    picker.animation_dur = 0.3;
    picker.toolViewBg_color =[UIColor greenColor];
    picker.componentFir_font = [UIFont systemFontOfSize:16];
    picker.componentStrFir_color = [UIColor redColor];;
    picker.componentBgFir_color = [UIColor lightGrayColor];
    picker.selectLblStr_font = [UIFont systemFontOfSize:20];
    picker.selectLblStr_color = [UIColor redColor];
    //点击确定按钮代码块调用
    picker.sureBtnBlock = ^(){

    };
    //获取选择的城市的信息
    [picker cityPikerGetSelectCity:^(NSMutableDictionary *dicSelectCity) {
        [self setTextLbl:dicSelectCity];
        NSLog(@"����RattanCityPicker:\n%@",dicSelectCity);
    }];
}

演示

SQSelectAddress

XXCityPickerView

RattanCityPicker

2015-04-13 12:23:21 u012588310 阅读数 2879

有时候需要用到城市列表,作为地址选择,所以写了个demo。

核心代码:

#pragma mark - 获取城市数据
-(void)getCityData
{
    NSString *path=[[NSBundle mainBundle] pathForResource:@"citydict"
                                                   ofType:@"plist"];
    self.cities = [NSMutableDictionary dictionaryWithContentsOfFile:path];
    
    [self.keys addObjectsFromArray:[[self.cities allKeys] sortedArrayUsingSelector:@selector(compare:)]];
    
    //添加热门城市
    NSString *strHot = @"热";
    [self.keys insertObject:strHot atIndex:0];
    [self.cities setObject:_arrayHotCity forKey:strHot];
}

#pragma mark - tableView
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 20.0;
}

-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    UIView *bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 20)];
    bgView.backgroundColor = [UIColor lightGrayColor];
    
    UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(13, 0, 250, 20)];
    titleLabel.backgroundColor = [UIColor clearColor];
    titleLabel.textColor = [UIColor blackColor];
    titleLabel.font = [UIFont systemFontOfSize:12];
    
    NSString *key = [_keys objectAtIndex:section];
    if ([key rangeOfString:@"热"].location != NSNotFound) {
        titleLabel.text = @"热门城市";
    }
    else
        titleLabel.text = key;
    
    [bgView addSubview:titleLabel];
    
    return bgView;
}

- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
{
    return _keys;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    // Return the number of sections.
    return [_keys count];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // Return the number of rows in the section.
    NSString *key = [_keys objectAtIndex:section];
    NSArray *citySection = [_cities objectForKey:key];
    return [citySection count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    
    NSString *key = [_keys objectAtIndex:indexPath.section];
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] ;
        cell.backgroundColor = [UIColor clearColor];
        cell.contentView.backgroundColor = [UIColor clearColor];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        
        [cell.textLabel setTextColor:[UIColor blackColor]];
        cell.textLabel.font = [UIFont systemFontOfSize:18];
    }
    cell.textLabel.text = [[_cities objectForKey:key] objectAtIndex:indexPath.row];
    return cell;
}
demo下载地址:点击打开链接

2016-08-10 13:32:46 Hanrovey 阅读数 4640

// 方法一
// 默认选中行,放在 reloadData 后

NSIndexPath *ip=[NSIndexPath indexPathForRow:0 inSection:0];
[tableView selectRowAtIndexPath:ip animated:YES scrollPosition:UITableViewScrollPositionBottom];

// 方法二:

NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
if ([myTableView.delegate respondsToSelector:@selector(tableView:willSelectRowAtIndexPath:)]) {
    [myTableView.delegate tableView:self.tableView willSelectRowAtIndexPath:indexPath];
}

 [myTableView selectRowAtIndexPath:indexPath animated:YES scrollPosition: UITableViewScrollPositionNone];
  if ([myTableView.delegate respondsToSelector:@selector(tableView:didSelectRowAtIndexPath:)]) {
    [myTableView.delegate tableView:self.tableView didSelectRowAtIndexPath:indexPath];
}

ios选择城市

阅读数 912

iOS开发UIDatePicker,UIPickerView

博文 来自: u010328250
没有更多推荐了,返回首页