iOS新手入门常见问题3 UITableViewController动态更新某一行Cell的值

2016年06月03日 iOS 13条评论 阅读4020次

博客 iOS新手入门常见问题3 UITableViewController动态更新某一行Cell的值

动态更新某一行Cell的值

要在满足某种条件下,经常要单独更新TableView某一行数据。更新某一行数据,当然要知道该Cell所在的sectionIndex和rowIndex。下面是根据已经的IndexPath更新该Cell的方法

// 得到该Cell的indexPath
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:3 inSection:0];
// 根据indexPath重新加载tableview
[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath, nil] withRowAnimation:UITableViewRowAnimationNone]; 

导航条上增加菜单点击后显示黑屏

在一个已经嵌入了NavigationBar的ViewController中,想在右边增加一个ButtonItem。 就在VC对应的m文件的viewDidLoad方法中添加了rightBarButtonItem。 又定义了rightBarButtonItem的点击事件。

SecondViewController *destVC = [[SecondViewController alloc] init];  
[self.navigationController pushViewController:destVC animated:YES]; 

结果发现这样可以转场到第二个画面,也能显示出导航栏,也默认带有返回按钮。最大的问题和缺憾就是显示的新画面是个黑屏!

其实Xcode已经为我们做好了自定义拖拽导航条项目的功能。在控件区域一下往下拉。会看到bar button item的控件,拖拽到导航条想要的位置即可。 有了导航条上实实在在能看到的控件,也就可以用鼠标拖动来选择要转场到哪个VC了。 整个过程完全不用写一行代码。

分享本文至:

WRITTEN BY

avatar
看了本文是不是觉得很赞,那就赶紧点击下面按钮分享给身边的朋友吧!

13 条评论

  1. <a href="http://www.salesmasterypro.net/air-jordan-retro-1-mujeres-naranja-obuvb">air jordan retro 1 mujeres naranja</a> <a href="http://www.sastafitness.net/adidas-zx-flux-full-sort-chaussuresc">adidas zx flux full sort</a> <a href="http://www.sattonet.net/hommes-nike-roshe-run-slip-gris-rose-kurpesg">hommes nike roshe run slip gris rose</a> <a href="http://www.savetheastrodome.net/curry-2-tout-blanc-nike-schuhea">curry 2 tout blanc nike</a> <a href="http://www.schildgen.net/nike-air-max-2015-gr%C3%B8nn-card-butyf">nike air max 2015 gr酶nn card</a> <a href="http://www.scogblog.net/yeezy-350-boost-oransje-gr%C3%B8nn-kurpesd">yeezy 350 boost oransje gr酶nn</a>
    nordseepflege http://www.nordseepflege.net/

  2. <a href="http://www.americalcharm.com/new-blance-500-barn-lilla-gr%C3%B8nn-obuve">new blance 500 barn lilla gr酶nn</a> <a href="http://www.ascrigar.com/adidas-zx-700-negro-and-azul-obuvg">adidas zx 700 negro and azul</a> <a href="http://www.blakantz.com/air-jordan-6-nero-infrarosso-aj6-schuhef">air jordan 6 nero infrarosso aj6</a> <a href="http://www.casasdaterra.com/nike-air-presto-grigio-marrone-obuve">nike air presto grigio marrone</a> <a href="http://www.dafuwh.com/adidas-superstar-b%C3%B8rn-gr%C3%B8n-lyser%C3%B8d-butye">adidas superstar b酶rn gr酶n lyser酶d</a> <a href="http://www.edukfun.com/nike-basketbtout-chaussures-kd-7-obuvc">nike basketbtout chaussures kd 7</a>
    evakloset http://www.evakloset.com/

  3. avatar leadhow

    <a href="http://www.sidecisions.com/nike-sb-dunk-high-noirout-obuvd">nike sb dunk high noirout</a> <a href="http://www.htmlpast.com/kobe-vii-chaussures-bon-march%C3%A9-scarpec">kobe vii chaussures bon march茅</a> <a href="http://www.djdikkethomas.com/new-blance-574-kinder-rosa-orange-schuhef">new blance 574 kinder rosa orange</a> <a href="http://www.dumpthatdebt.com/dam%C3%A4nner-air-jordan-retro-5-alle-blau-scarpef">dam盲nner air jordan retro 5 alle blau</a> <a href="http://www.syderagencys.com/asics-onitsuka-tiger-mexico-66-himmelblau-lila-scarpeg">asics onitsuka tiger mexico 66 himmelblau lila</a> <a href="http://www.atvhdizle.com/nike-roshe-run-hyp-grigio-rosso-kurpesa">nike roshe run hyp grigio rosso</a>
    leadhow http://www.leadhow.com/

  4. avatar rejuvmedia

    <a href="http://www.myfraimz.com/nike-air-force-1-low-triple-blanc-schuheb">nike air force 1 low triple blanc</a> <a href="http://www.winnercells.com/nike-ash-jerome-baker-backer-nfl-55-miami-dolphins-pullover-hoodie-nflu">nike ash jerome baker backer nfl 55 miami dolphins pullover hoodie</a> <a href="http://www.atppest.com/nike-air-jordan-20-skou">nike air jordan 20</a> <a href="http://www.windriftbar.com/nike-flyknit-racer-april-7-years-old-runninge">nike flyknit racer april 7 years old</a> <a href="http://www.kidtokidboise.com/old-fashioned-puma-shoes-zapatosu">old fashioned puma shoes</a> <a href="http://www.mesmertronic.com/nike-kd-7-hvid-and-r%C3%B8d-chaussuresa">nike kd 7 hvid and r酶d</a>
    rejuvmedia http://www.rejuvmedia.com/

  5. avatar maxcologne

    <a href="http://www.gilbertgafah.com/air-jordan-aero-mania-verde-p%C3%BArpura-schuheb">air jordan aero mania verde p煤rpura</a> <a href="http://www.kiligold.com/nike-free-run-2-beach-gamma-blu-chaussuresd">nike free run 2 beach gamma blu</a> <a href="http://www.maletaboricua.com/nike-free-run-uk-rosado-butyg">nike free run uk rosado</a> <a href="http://www.pcwolftech.com/air-jordan-retro-10-silber-royal-blau-scarpea">air jordan retro 10 silber royal blau</a> <a href="http://www.sangcheviet.com/vibram-fivefingers-jaya-gr%C3%B8nn-hvit-schuheb">vibram fivefingers jaya gr酶nn hvit</a> <a href="http://www.vihjelper.com/adidas-ultra-boost-energy-r%C3%B8d-3.0-svart-butyf">adidas ultra boost energy r酶d 3.0 svart</a>
    maxcologne http://www.maxcologne.com/

  6. avatar davesantos

    <a href="http://www.impulsodigital.net/zx-flux-svart-and-r%C3%B8d-kurpesf">zx flux svart and r酶d</a> <a href="http://www.industrialamps.net/nike-internationalist-utility-hommes-chaussure-rack-schuhea">nike internationalist utility hommes chaussure rack</a> <a href="http://www.jifivillage.net/air-jordan-3-retro-2001-schwarz-cem%C3%A4nnert-grau-butyf">air jordan 3 retro 2001 schwarz cem盲nnert grau</a> <a href="http://www.jolkona.net/nike-hyperdunk-2014-wolf-grau-kurpesc">nike hyperdunk 2014 wolf grau</a> <a href="http://www.justadrink.net/air-jordan-12-retro-obsidian-blanc-university-bleu-butya">air jordan 12 retro obsidian blanc university bleu</a> <a href="http://www.kouder.net/air-jordan-retro-6-gr%C3%B8n-glow-schuheg">air jordan retro 6 gr酶n glow</a>
    davesantos http://www.davesantos.net/

  7. avatar r011o9ov

    <a href="http://www.eqjryy86.com/nike-lebron-soldier-9-sort-bl%C3%A5-obuva">nike lebron soldier 9 sort bl氓</a> <a href="http://www.ns540sal.com/le-coq-sportif-maschio-scarpe-rosa-butyc">le coq sportif maschio scarpe rosa</a> <a href="http://www.9zoqzpyg.com/air-jordan-2-qf-university-bleu-blanc-scarpeb">air jordan 2 qf university bleu blanc</a> <a href="http://www.cbz431nj.com/nike-internationalist-mid-royal-queen-kurpesf">nike internationalist mid royal queen</a> <a href="http://www.em864ynh.com/air-max-90-kinder-vente-scarpea">air max 90 kinder vente</a> <a href="http://www.640q0gnd.com/nike-free-run-5.0-gul-xanax-obuvc">nike free run 5.0 gul xanax</a>
    r011o9ov http://www.r011o9ov.com/

  8. avatar badacamshotel

    <a href="http://www.ntygadget.com/mennns-asics-gel-lyte-5-hvit-s%C3%B8lv-obuvc">mennns asics gel lyte 5 hvit s酶lv</a> <a href="http://www.purchasetulsa.com/mitchell-and-ness-50th-patch-mens-dan-fouts-authentic-electric-blue-alternate-jersey-los-angeles-chargers-nfl-14-throwback-nflw">mitchell and ness 50th patch mens dan fouts authentic electric blue alternate jersey los angeles chargers nfl 14 throwback</a> <a href="http://www.pennywave.com/kirk-cousins-8-washington-redskins-jersey-nflv">kirk cousins 8 washington redskins jersey</a> <a href="http://www.scoptix.com/kobe-9-low-cut-shoes-grey-skog">kobe 9 low cut shoes grey</a> <a href="http://www.domodrzwi.com/jordan-future-cool-grey-high-skob">jordan future cool grey high</a> <a href="http://www.magneticduo.com/nba-hat-spurs-hatb">nba hat spurs</a>
    badacamshotel http://www.badacamshotel.com/

  9. avatar disorderedliberty

    <a href="http://www.tahoebathworks.net/stefan-janoski-max-l-obsdn-negro-par-nike-sb-schuhea">stefan janoski max l obsdn negro par nike sb</a> <a href="http://www.teknicinfo.net/asics-gel-sendai-2-gold-gr%C3%BCn-chaussuresa">asics gel sendai 2 gold gr眉n</a> <a href="http://www.thylaneblondeau.net/nike-kvinders-air-max-1-yoth-obuva">nike kvinders air max 1 yoth</a> <a href="http://www.tidewaterusadance.net/nike-huarache-femminile-vendita-butyc">nike huarache femminile vendita</a> <a href="http://www.torukoryoko.net/under-armour-curry-one-r%C3%B8d-s%C3%B8lv-scarpeb">under armour curry one r酶d s酶lv</a> <a href="http://www.toytraders.net/air-jordan-horizon-noir-hommesthe-verte-kurpesf">air jordan horizon noir hommesthe verte</a>
    disorderedliberty http://www.disorderedliberty.net/

  10. avatar relsflorida

    <a href="http://www.cremontana.com/nike-sb-blazer-mens-grey-red-sneakere">nike sb blazer mens grey red</a> <a href="http://www.holeninegolf.com/nike-air-max-97-gold-gr%C3%BCn-obuvc">nike air max 97 gold gr眉n</a> <a href="http://www.boobseze.com/nike-limited-nazair-jones-jersey-92-nfl-seattle-seahawks-rush-drift-fashion-youth-navy-blue-nflw">nike limited nazair jones jersey 92 nfl seattle seahawks rush drift fashion youth navy blue</a> <a href="http://www.divyangshop.com/kirk-cousins-8-washington-redskins-jersey-nflv">kirk cousins 8 washington redskins jersey</a> <a href="http://www.caveduperreux.com/air-max-2015-womens-wmns-skog">air max 2015 womens wmns</a> <a href="http://www.fabloomsilk.com/nike-mens-lebron-12-basketball-shoes-skob">nike mens lebron 12 basketball shoes</a>
    relsflorida http://www.relsflorida.com/

  11. avatar mushigiftpack

    <a href="http://www.lauraundleon.com/new-era-hat-strapback-oakley-hata">new era hat strapback oakley</a> <a href="http://www.michaelphenow.com/orange-yellow-mens-nike-hyperdunk-2017-shoes-runninge">orange yellow mens nike hyperdunk 2017 shoes</a> <a href="http://www.kguides.com/reebok-royal-ec-ride-rouge-noir-schuhea">reebok royal ec ride rouge noir</a> <a href="http://www.nvusforex.com/adidas-barn-sko-bl%C3%A5-s%C3%B8lv-scarpeb">adidas barn sko bl氓 s酶lv</a> <a href="http://www.dinerwaresb.com/womens-nike-internationalist-red-italy-shoeso">womens nike internationalist red italy</a> <a href="http://www.slipoverfx.com/lebron-12-chaussures-list-kurpesb">lebron 12 chaussures list</a>
    mushigiftpack http://www.mushigiftpack.com/

  12. avatar ductambag

    <a href="http://www.evolutionecig.com/air-max-90-hyperfuse-negro-marr%C3%B3n-chaussuresa">air max 90 hyperfuse negro marr贸n</a> <a href="http://www.georginabauer.com/aldon-smith-99-jersey-city-nfle">aldon smith 99 jersey city</a> <a href="http://www.bootsoffprice.com/adidas-mens-derby-ii-neo-lifestyle-shoes-runningg">adidas mens derby ii neo lifestyle shoes</a> <a href="http://www.theprintjobs.com/nfl-pittsburgh-steelers-color-rush-limited-antonio-brown-mens-football-jersey-nflv">nfl pittsburgh steelers color rush limited antonio brown mens football jersey</a> <a href="http://www.dbajournal.com/nike-free-run-5.0-hot-pink-and-grey-trainersa">nike free run 5.0 hot pink and grey</a> <a href="http://www.procomedian.com/nike-foamposite-silber-grau-scarped">nike foamposite silber grau</a>
    [url=http://www.ductambag.com/]ductambag[/url]

  13. avatar erickasouza

    <a href="http://www.dcrcustoms.com/mackage-satchel-mens-cologne-mackaged">mackage satchel mens cologne</a> <a href="http://www.bermudabrands.com/tory-burch-black-patent-leather-flats-toryburchr">tory burch black patent leather flats</a> <a href="http://www.alarmselpaso.com/nike-free-3.0-v4-kvinners-r%C3%B8d-runninga">nike free 3.0 v4 kvinners r酶d</a> <a href="http://www.demngoibet.com/mackage-jacket-leather-sleeves-mackager">mackage jacket leather sleeves</a> <a href="http://www.wtaarchitects.com/michael-kors-bedford-bag-orange-il-mkf">michael kors bedford bag orange il</a> <a href="http://www.bibleofpeace.com/moncler-coat-ruffle-girls-comforter-monclerd">moncler coat ruffle girls comforter</a>
    erickasouza http://www.erickasouza.com/

欢迎留言




用户登录

sitemap